Components

Corkboard

A wooden-framed corkboard with notes you can pick up. Drag them with a pointer, or focus one and use the arrow keys to move it and R to turn it. Positions are plain JSON you can store and restore.

Install

terminal
npx shadcn@latest add @wobko/corkboard

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

Examples

Default

Pick a note up and move it. Or focus one, then use the arrow keys, R to turn it, Enter to bring it to the front.

Any paper

A note is a Paper: sticky notes, an index card with a list, a kraft tag, a photo. With bare, any paper object of the library can be the note. Same drag, same keys.

Saved layout

Controlled positions: the board is a JSON value, so a layout can be saved, shared and restored. Move things, then reset.

API reference

Corkboard

The board: a frame of marker and felt round a cork made from one seeded speckle tile (an SVG pattern, so a big board costs no more cork than a small one). It is a positioned box; give it a height and put notes in it.

PropTypeDefaultDescription
value / defaultValueRecord<string, { x?, y?, r?, z? }>-Positions by note id: x and y in px from the top-left of the cork, r the turn in degrees, z the stacking order. Only notes that were moved, turned or raised are in it.
onValueChange(value) => void-Called when a drag ends, and on every key move, turn or raise.
labelstring"Corkboard"Accessible name of the group.
disabledbooleanfalseNothing can be picked up or moved; notes leave the tab order.
seedstring | number-Pins the hand of the frame and the cork.

CorkboardNote

A piece of paper on the board (a Paper: sticky note by default, any stock works) held by a push-pin or a strip of tape. Lifting it (dragging) raises the pin and lengthens the shadow; dropping it pops the pin back in.

PropTypeDefaultDescription
idstring-Unique id; the key in the board's value.
x / ynumber16Where it starts, px from the top-left of the cork.
rotatenumber-How it starts turned, degrees. Default a small seeded angle (flat in calm density).
stockStockName"sticky-yellow"What it is made of: sticky-*, index-card, photo, kraft…
pinned / pinColorboolean / PaintKeytrueA pin, or a strip of tape when false. The pin color is seeded from the id unless given.
labelstring-Accessible name (default the id), also used in announcements.
paperPropsPaperProps-Anything else the sheet takes.
barebooleanfalseNo sheet of its own: the children are the paper (a StickyNote, a Polaroid, a Ticket). The note still moves, turns, raises and is pinned.

Accessibility

  • The board is a named group; every note is a focusable group with aria-roledescription "note", described by one line of instructions.
  • Arrow keys move the focused note by 8 px (Shift 32 px), R turns it 4 degrees clockwise (Shift+R back, limited to 24), Enter or Space brings it to the front. Notes stay inside the cork.
  • Where a note ended up is announced politely, once, after the last key press ("Call mum at 56, 30.").
  • Pointer: notes are picked up anywhere except on links, buttons, inputs and elements marked data-corkboard-nodrag, so a note can hold controls. Escape while dragging with the keyboard focus on the note puts it back.
  • The focus ring is drawn round the note; it never depends on color alone. Windows high contrast gives the note a real outline.
  • Reduced motion: no lift animation, the pin does not pop. Calm density: notes lie flat and the pins are left out.
  • Resizing: a layout saved on a wide board is drawn inside a narrower one (a note is pulled back in as the cork changes size), while the stored positions are left alone, so widening the board again puts everything where it was saved.
  • Every note is a tab stop, so a board of fifty notes is fifty Tab presses: keep boards to a handful of notes, or put the board behind a skip link. Touch: a note is touch-action none (a drag on it never scrolls the page), the cork around the notes still scrolls.

Source

The files the CLI copies into your project.

Loading the source