# Sticky note tooltip

> A taped sticky note slaps onto the planner, tilted with a lifted corner, when you hover or focus the note icon.

- Category: [Tooltips](https://library.aimran.es/components/tooltips)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tip-sticky-note
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Hover the small note icon in a day planner and a yellow sticky note lands on the page with a quick springy rotation, a strip of translucent tape and a curled corner. The text uses a handwritten looking system font, so it reads like something a person jotted down. It suits calendars, task lists, CRM timelines and notebooks.

Pick the paper color with the main color and the accent of the date with the second. Keep the note to one or two lines, and use it for personal comments rather than system messages so the metaphor stays honest.

## Code

### HTML

```html
<div class="uvq08-stk"><div class="pl"><p class="dy"><b>14</b><span>Thursday</span></p><ul><li><time>09:00</time><span class="nm">Coffee with Marta</span></li><li><time>10:00</time><span class="nm">Design meeting</span><span class="wr pk"><button type="button" class="ic" aria-label="View note" aria-describedby="uvq08-stk-t"></button><span class="po" role="tooltip" id="uvq08-stk-t"><i class="tp" aria-hidden="true"></i>Bring the fabric samples and the new quote</span></span></li><li><time>13:30</time><span class="nm">Lunch with the team</span></li></ul></div></div>
```

### CSS

```css
.uvq08-stk {
  --c1: #ffd23f;
  --c2: #e4572e;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq08-stk {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  padding-top: 7.6em;
}

.uvq08-stk .pl {
  width: 16em;
  padding: 1em 1.1em .5em;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent),0 24px 48px -30px rgba(0,0,0,.45);
}

.uvq08-stk .dy {
  display: flex;
  align-items: baseline;
  gap: .45em;
  margin: 0 0 .5em;
}

.uvq08-stk .dy b {
  font: 700 2em/1 Georgia,"Times New Roman",serif;
  color: var(--c2);
}

.uvq08-stk .dy span {
  font-weight: 650;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq08-stk ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.uvq08-stk li {
  display: flex;
  align-items: center;
  gap: .8em;
  min-height: 2.6em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 8%,transparent);
  font-size: .88em;
}

.uvq08-stk time {
  width: 2.8em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq08-stk .nm {
  flex: 1;
}

.uvq08-stk .wr {
  position: relative;
}

.uvq08-stk .ic {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: block;
  width: 1.6em;
  height: 1.6em;
  border-radius: .15em;
  background: linear-gradient(to left bottom,transparent 50%,rgba(0,0,0,.22) 0) no-repeat 100% 0/.5em .5em,linear-gradient(-135deg,transparent .35em,var(--c1) 0);
  box-shadow: 0 .15em .25em rgba(0,0,0,.2);
  transform: rotate(-6deg);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-stk .ic:hover {
  transform: rotate(4deg) scale(1.12);
}

.uvq08-stk .ic:active {
  transform: scale(.9);
}

.uvq08-stk .ic:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-stk .po {
  position: absolute;
  right: -1em;
  bottom: calc(100% + .7em);
  z-index: 3;
  display: block;
  width: 9.5em;
  min-height: 7em;
  padding: 1.5em 1em 1em;
  font: 500 1.05em/1.35 "Segoe Print","Bradley Hand","Chalkboard SE","Marker Felt","Comic Sans MS",cursive;
  color: #3d3200;
  background: linear-gradient(170deg,color-mix(in srgb,var(--c1) 75%,#fff),var(--c1));
  box-shadow: 0 1em 1.2em -.8em rgba(0,0,0,.5);
  transform: rotate(-14deg) scale(1.25) translateY(-.6em);
  transform-origin: 50% 0;
  opacity: 0;
  visibility: hidden;
  transition: all calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-stk .po::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.5em;
  height: 1.5em;
  background: linear-gradient(315deg,var(--bg) 0 47%,color-mix(in srgb,var(--c1) 65%,#000) 50%,color-mix(in srgb,var(--c1) 70%,#fff));
  box-shadow: -.15em -.15em .3em rgba(0,0,0,.12);
}

.uvq08-stk .tp {
  position: absolute;
  left: 50%;
  top: -.55em;
  width: 4em;
  height: 1.2em;
  translate: -50% 0;
  rotate: 4deg;
  background: rgba(255,255,255,.55);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  clip-path: polygon(4% 0,96% 8%,100% 100%,0 92%);
}

.uvq08-stk .wr:hover .po,.uvq08-stk .wr:focus-within .po,.uvq08-stk .wr.pk .po {
  opacity: 1;
  visibility: visible;
  transform: rotate(-4deg);
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-stk,.uvq08-stk *,.uvq08-stk *::before,.uvq08-stk *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq08-stk").forEach(el => {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq08-stk {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  padding-top: 7.6em;
}

.uvq08-stk .pl {
  width: 16em;
  padding: 1em 1.1em .5em;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent),0 24px 48px -30px rgba(0,0,0,.45);
}

.uvq08-stk .dy {
  display: flex;
  align-items: baseline;
  gap: .45em;
  margin: 0 0 .5em;
}

.uvq08-stk .dy b {
  font: 700 2em/1 Georgia,"Times New Roman",serif;
  color: var(--c2);
}

.uvq08-stk .dy span {
  font-weight: 650;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq08-stk ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.uvq08-stk li {
  display: flex;
  align-items: center;
  gap: .8em;
  min-height: 2.6em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 8%,transparent);
  font-size: .88em;
}

.uvq08-stk time {
  width: 2.8em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq08-stk .nm {
  flex: 1;
}

.uvq08-stk .wr {
  position: relative;
}

.uvq08-stk .ic {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: block;
  width: 1.6em;
  height: 1.6em;
  border-radius: .15em;
  background: linear-gradient(to left bottom,transparent 50%,rgba(0,0,0,.22) 0) no-repeat 100% 0/.5em .5em,linear-gradient(-135deg,transparent .35em,var(--c1) 0);
  box-shadow: 0 .15em .25em rgba(0,0,0,.2);
  transform: rotate(-6deg);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-stk .ic:hover {
  transform: rotate(4deg) scale(1.12);
}

.uvq08-stk .ic:active {
  transform: scale(.9);
}

.uvq08-stk .ic:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-stk .po {
  position: absolute;
  right: -1em;
  bottom: calc(100% + .7em);
  z-index: 3;
  display: block;
  width: 9.5em;
  min-height: 7em;
  padding: 1.5em 1em 1em;
  font: 500 1.05em/1.35 "Segoe Print","Bradley Hand","Chalkboard SE","Marker Felt","Comic Sans MS",cursive;
  color: #3d3200;
  background: linear-gradient(170deg,color-mix(in srgb,var(--c1) 75%,#fff),var(--c1));
  box-shadow: 0 1em 1.2em -.8em rgba(0,0,0,.5);
  transform: rotate(-14deg) scale(1.25) translateY(-.6em);
  transform-origin: 50% 0;
  opacity: 0;
  visibility: hidden;
  transition: all calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-stk .po::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.5em;
  height: 1.5em;
  background: linear-gradient(315deg,var(--bg) 0 47%,color-mix(in srgb,var(--c1) 65%,#000) 50%,color-mix(in srgb,var(--c1) 70%,#fff));
  box-shadow: -.15em -.15em .3em rgba(0,0,0,.12);
}

.uvq08-stk .tp {
  position: absolute;
  left: 50%;
  top: -.55em;
  width: 4em;
  height: 1.2em;
  translate: -50% 0;
  rotate: 4deg;
  background: rgba(255,255,255,.55);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  clip-path: polygon(4% 0,96% 8%,100% 100%,0 92%);
}

.uvq08-stk .wr:hover .po,.uvq08-stk .wr:focus-within .po,.uvq08-stk .wr.pk .po {
  opacity: 1;
  visibility: visible;
  transform: rotate(-4deg);
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-stk,.uvq08-stk *,.uvq08-stk *::before,.uvq08-stk *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
}

export default function TipStickyNote() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#ffd23f",
          "--c2": "#e4572e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-stk"><div className="pl"><p className="dy"><b>14</b><span>Thursday</span></p><ul><li><time>09:00</time><span className="nm">Coffee with Marta</span></li><li><time>10:00</time><span className="nm">Design meeting</span><span className="wr pk"><button type="button" className="ic" aria-label="View note" aria-describedby="uvq08-stk-t"></button><span className="po" role="tooltip" id="uvq08-stk-t"><i className="tp" aria-hidden="true"></i>Bring the fabric samples and the new quote</span></span></li><li><time>13:30</time><span className="nm">Lunch with the team</span></li></ul></div></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Sticky note tooltip” block (Tooltips) from AIMRAN Library to my project.

## What it is
A taped sticky note slaps onto the planner, tilted with a lifted corner, when you hover or focus the note icon.

## Chosen settings
- Main color: #ffd23f
- Secondary color: #e4572e
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Llevar las muestras de tela y el presupuesto nuevo"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq08-stk {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  padding-top: 7.6em;
}

.uvq08-stk .pl {
  width: 16em;
  padding: 1em 1.1em .5em;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent),0 24px 48px -30px rgba(0,0,0,.45);
}

.uvq08-stk .dy {
  display: flex;
  align-items: baseline;
  gap: .45em;
  margin: 0 0 .5em;
}

.uvq08-stk .dy b {
  font: 700 2em/1 Georgia,"Times New Roman",serif;
  color: var(--c2);
}

.uvq08-stk .dy span {
  font-weight: 650;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq08-stk ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.uvq08-stk li {
  display: flex;
  align-items: center;
  gap: .8em;
  min-height: 2.6em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 8%,transparent);
  font-size: .88em;
}

.uvq08-stk time {
  width: 2.8em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq08-stk .nm {
  flex: 1;
}

.uvq08-stk .wr {
  position: relative;
}

.uvq08-stk .ic {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: block;
  width: 1.6em;
  height: 1.6em;
  border-radius: .15em;
  background: linear-gradient(to left bottom,transparent 50%,rgba(0,0,0,.22) 0) no-repeat 100% 0/.5em .5em,linear-gradient(-135deg,transparent .35em,var(--c1) 0);
  box-shadow: 0 .15em .25em rgba(0,0,0,.2);
  transform: rotate(-6deg);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-stk .ic:hover {
  transform: rotate(4deg) scale(1.12);
}

.uvq08-stk .ic:active {
  transform: scale(.9);
}

.uvq08-stk .ic:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-stk .po {
  position: absolute;
  right: -1em;
  bottom: calc(100% + .7em);
  z-index: 3;
  display: block;
  width: 9.5em;
  min-height: 7em;
  padding: 1.5em 1em 1em;
  font: 500 1.05em/1.35 "Segoe Print","Bradley Hand","Chalkboard SE","Marker Felt","Comic Sans MS",cursive;
  color: #3d3200;
  background: linear-gradient(170deg,color-mix(in srgb,var(--c1) 75%,#fff),var(--c1));
  box-shadow: 0 1em 1.2em -.8em rgba(0,0,0,.5);
  transform: rotate(-14deg) scale(1.25) translateY(-.6em);
  transform-origin: 50% 0;
  opacity: 0;
  visibility: hidden;
  transition: all calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-stk .po::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.5em;
  height: 1.5em;
  background: linear-gradient(315deg,var(--bg) 0 47%,color-mix(in srgb,var(--c1) 65%,#000) 50%,color-mix(in srgb,var(--c1) 70%,#fff));
  box-shadow: -.15em -.15em .3em rgba(0,0,0,.12);
}

.uvq08-stk .tp {
  position: absolute;
  left: 50%;
  top: -.55em;
  width: 4em;
  height: 1.2em;
  translate: -50% 0;
  rotate: 4deg;
  background: rgba(255,255,255,.55);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  clip-path: polygon(4% 0,96% 8%,100% 100%,0 92%);
}

.uvq08-stk .wr:hover .po,.uvq08-stk .wr:focus-within .po,.uvq08-stk .wr.pk .po {
  opacity: 1;
  visibility: visible;
  transform: rotate(-4deg);
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-stk,.uvq08-stk *,.uvq08-stk *::before,.uvq08-stk *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
}

export default function TipStickyNote() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#ffd23f",
          "--c2": "#e4572e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-stk"><div className="pl"><p className="dy"><b>14</b><span>Thursday</span></p><ul><li><time>09:00</time><span className="nm">Coffee with Marta</span></li><li><time>10:00</time><span className="nm">Design meeting</span><span className="wr pk"><button type="button" className="ic" aria-label="View note" aria-describedby="uvq08-stk-t"></button><span className="po" role="tooltip" id="uvq08-stk-t"><i className="tp" aria-hidden="true"></i>Bring the fabric samples and the new quote</span></span></li><li><time>13:30</time><span className="nm">Lunch with the team</span></li></ul></div></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
