Four sides
The page is bound along whichever edge faces the middle of the screen: the coils hang on the left of a right-hand page, along the bottom of a page that comes from the top.
A notebook page that slides in from the edge of the screen. It is bound along the edge that faces the middle: spiral wire through punched holes, three binder holes, a perforated tear line, or torn out of a pad. Good for settings, filters, carts and mobile navigation.
npx shadcn@latest add @wobko/sheet第一次使用?先把 registry 加进 components.json。 如何安装
The page is bound along whichever edge faces the middle of the screen: the coils hang on the left of a right-hand page, along the bottom of a page that comes from the top.
Five ways to finish the inner edge: spiral coils, three binder holes, a perforated tear line, a torn pad edge, or nothing. Perf and torn are drawn when the page opens; the others are cheap strips.
The shadcn demo: a form in a side sheet with the footer pushed to the bottom.
A menu page from the left with holes for a binder. The list scrolls inside the page (`overflow-y-auto` on the list, never on the sheet) and every link closes it.
Official `sheet-demo`, same parts and layout: header, two fields on a grid that fills the height, a footer with Save and Close. The page slides in from the right, bound with a wire coil along its left edge. Escape, the x and a click outside all put it away.
Official `sheet-side`: four triggers in a two-column grid, one page per edge. Three fixes to the original: its inputs were controlled with no `onChange` (frozen), so they take `defaultValue`; its ids repeated four times, so each carries its side; and the field grid gets `px-4` to line up with the header.
The page: a Paper that is also the Radix dialog. Flush to its edge, never tilted, with its shadow cast toward the page underneath. It does not scroll itself (the shadow and coils would be clipped): put long content in a child with `overflow-y-auto`.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| side | "top" | "right" | "bottom" | "left" | "right" | The edge it slides in from. |
| binding | "spiral" | "holes" | "perf" | "torn" | "none" | "spiral" | How the inner edge is finished. `spiral`: wire coils through punched holes, crossing onto the dimmed page. `holes`: three binder holes with reinforcement rings. `perf`: a perforated tear line. `torn`: torn out of a pad. `none`: a plain cut edge. |
| showCloseButton | boolean | true | The doodled x. It moves clear of the coils when they run along its corner. |
| stock | StockName | "paper" | What the page is made of (paper, pad, graph, kraft, ...). |
| rules | RuleName | "none" | Printed rules (`ruled`, `graph`, `dots` ...). Off by default. |
| seed | string | number | - | Pins the hand: the same seed draws the same coils and edge. |
CLI 会复制进你项目的文件。
正在加载源码