Components

Sticky note

A square of colored paper with a gum band, turned a little more than a page. Five pads, any size, written in marker. It can curl a corner, hang from a pin or a strip of tape, and grow a tick box that is ticked with a felt pen.

Install

terminal
npx shadcn@latest add @wobko/sticky-note

First time here? Add the registry to components.json first. How to install

Examples

Five pads

Yellow, green, orange, pink and blue, each turned by its own seeded angle. The first word says what the note is.

Curled, pinned, taped

`curl` lifts the bottom-right corner; `fastener` and `tape` hold a note up. Any size works: the text wraps and the sheet follows.

Done

Pass `done` and the note gets a pencil tick box. Add `onDoneChange` and the box can be pressed: the tick is written with a felt pen and the text struck through. A note that loads done just shows it.

A team board

A real board: notes you tick off as the week goes, laid on a card. Each note is a labeled group with its own checkbox; the tick is written when you press it.

API reference

StickyNote

A Paper on a sticky stock: 11 rem wide and at least 10 rem tall by default, padded under the gum band, set in the script font. Its sheet is CSS, so it resizes freely and a wall of them draws no SVG.

PropTypeDefaultDescription
color"yellow" | "green" | "orange" | "pink" | "blue""yellow"Which pad it came off.
doneboolean-Passing it adds a pencil tick box in the top corner (mirrored in RTL). `true` writes the tick with a felt pen and strikes the content; a note that loads done does not replay the tick. Leave it out for a plain note.
onDoneChange(done: boolean) => void-Makes the tick box a real control: a `role="checkbox"` button (32 px, over the drawn box) that asks for the opposite of `done` on click or Space. `done` stays yours (controlled). Without it the box only shows the state.
doneLabelstring"Done"What a screen reader says for a done note (visually hidden text before the content), and the name of the tick box when it is a control: make it say which note (`Design: done`) when a board has several.
curlbooleanfalseLift the bottom-right corner (draws the sheet as SVG: use it for a few, not a hundred).
fastener / tape / tapeKindPaper props-Hang it from a push-pin, a paper clip or a strip of tape.
tilt / seed / shadow / edgePaper props-Stickies turn up to 1.6 degrees; seed pins the hand. A torn or deckled edge works too.

Accessibility

  • A note is a plain `div`. Give it `role="note"` or `as`-like semantics through props when it means more (for instance `role="group"` with an `aria-label` in a board of notes).
  • The gum band, curl, pin and tape are aria-hidden decoration. The tick box is drawing only unless you pass `onDoneChange`, and then it is a real checkbox (named by `doneLabel`, Space toggles, `aria-checked` follows `done`). A done note without it says "Done." to screen readers through hidden text; either way it is struck through, so meaning never rests on color or the drawing alone.
  • Ink on every pad is at least 9:1; struck-through text switches to ink-soft (5.8:1 or better). Tilt is zero in calm density.
  • Sticky text is real DOM and wraps at any size (`break-words`), so a note resized by its container never clips.

Source

The files the CLI copies into your project.

Loading the source