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.
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.
npx shadcn@latest add @wobko/corkboard第一次使用?先把 registry 加进 components.json。 如何安装
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.
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.
Controlled positions: the board is a JSON value, so a layout can be saved, shared and restored. Move things, then reset.
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.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| value / defaultValue | Record<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. |
| label | string | "Corkboard" | Accessible name of the group. |
| disabled | boolean | false | Nothing can be picked up or moved; notes leave the tab order. |
| seed | string | number | - | Pins the hand of the frame and the cork. |
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.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| id | string | - | Unique id; the key in the board's value. |
| x / y | number | 16 | Where it starts, px from the top-left of the cork. |
| rotate | number | - | How it starts turned, degrees. Default a small seeded angle (flat in calm density). |
| stock | StockName | "sticky-yellow" | What it is made of: sticky-*, index-card, photo, kraft… |
| pinned / pinColor | boolean / PaintKey | true | A pin, or a strip of tape when false. The pin color is seeded from the id unless given. |
| label | string | - | Accessible name (default the id), also used in announcements. |
| paperProps | PaperProps | - | Anything else the sheet takes. |
| bare | boolean | false | No sheet of its own: the children are the paper (a StickyNote, a Polaroid, a Ticket). The note still moves, turns, raises and is pinned. |
CLI 会复制进你项目的文件。
正在加载源码