A bookmark
Press it: the ghost becomes a ribbon that settles in with a little turn. It is a toggle button, so Space and Enter work, and its state is `aria-pressed`.
A ribbon bookmark you can press. Unpressed, a dashed pencil ghost of a ribbon marks the place; pressed, the woven, edge-stitched cloth ribbon hangs there in its color and casts a short shadow. It is a Toggle underneath, so `aria-pressed`, Space and Enter come for free. `BookmarkRibbon` is the same ribbon as a page marker with no behavior.
npx shadcn@latest add @wobko/bookmark第一次使用?先把 registry 加进 components.json。 如何安装
Press it: the ghost becomes a ribbon that settles in with a little turn. It is a toggle button, so Space and Enter work, and its state is `aria-pressed`.
Every stationery accent. Each ribbon is woven and edge-stitched, lit from the upper left, a hair off straight.
`BookmarkRibbon` is the ribbon with no behavior: decoration that hangs out of the top of a sheet or a notebook.
A real use: save articles for later. Each card holds a Bookmark; the count follows. State lives in your app, as with any toggle.
A Radix Toggle (a `button`) 2 rem wide and 3 rem high, with a hit area 6 px larger all round. It takes every Toggle prop. Its content is its accessible name (default "Bookmark"), visually hidden.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| tone | Accent | "tomato" | The ribbon's color: tomato, tangerine, lemon, grass, teal, sky, grape or bubblegum. |
| pressed / defaultPressed / onPressedChange | boolean / boolean / (pressed: boolean) => void | - | As Toggle: controlled or not. |
| disabled | boolean | - | A pale ghost that cannot be pressed. |
| tilt / seed / size | boolean | number / string | number / [w, h] | - | A seeded turn under 1.4 degrees (flat in calm density); pins the hand; the box in px for server-rendered drawings. |
The ribbon alone, hanging: an aria-hidden, pointer-events-none `div` for a page marker. Place it with `absolute -top-1 end-6` on a sheet.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| tone | Accent | "tomato" | The ribbon's color. |
CLI 会复制进你项目的文件。
正在加载源码