Stocks
Paper is a recipe: a color, a tooth, a shadow and the rules printed on it. Each stock lies at its own small angle.
A sheet of paper on the desk: a stock (paper, slip, index card, graph, kraft, sticky notes ...), an edge (cut, torn, deckle, pinked ...), printed rules, a shadow and a small seeded tilt. The sheet turns; your content never does.
npx shadcn@latest add @wobko/paper第一次使用?先把 registry 加进 components.json。 如何安装
Paper is a recipe: a color, a tooth, a shadow and the rules printed on it. Each stock lies at its own small angle.
A plain cut is pure CSS. Torn, deckled, pinked, perforated and scalloped edges draw their outline once, with a fringe of torn fibers.
The `tape` shorthand lays strips across a corner, along the top or across both corners. A `fastener` holds a sheet with a clip, a pin, a staple or a binder clip.
Printed rules are part of the sheet, so they turn with it and the text stays upright. Set the line height to the rule pitch (28 px) and start the first line 16 px down (p-4) and the words sit on the lines, baseline 2 to 3 px above the rule. Each rule is printed 8 px above the bottom of its line; --ll-rule-offset tunes that.
Sticky notes are turned a little more than pages, cast a shadow that lifts at the foot, and can curl a corner. One note per meaning; the first word says what it is.
Thermal paper with pinked top and bottom, a mono print and a dashed total. The `receipt` stock is the same recipe as every other, cut differently.
A container whose background is drawn paper. A plain cut edge is pure CSS (baked tooth tiles, a lit gradient, an umber shadow stack): no SVG at all. A torn, deckled, crimped, pinked, perforated or scalloped edge is the same CSS sheet cut to a drawn outline (`clip-path`), with a small svg of plain paths for the fiber fringe and the edge line: no texture lives in the svg, so a page of drawn sheets costs what a page of cut ones does. Everything behind the content turns together by `--ll-tilt`; children are upright. A drawn edge is a few px larger than the box on every side (the fringe) and a turned sheet's corners swing by half its width times the angle, so a sheet that ends flush with the window (a full-width page, a sheet at the very bottom) can scroll it by that much: put it in a container with `overflow-x-clip` (`overflow-clip` at the bottom), or lay it square with `tilt={false}`.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| stock | "paper" | "card" | "slip" | "index-card" | "graph" | "dot-grid" | "check" | "ledger" | "pad" | "kraft" | "napkin" | "sticky-yellow" | "sticky-green" | "sticky-orange" | "sticky-pink" | "sticky-blue" | "photo" | "parchment" | "receipt" | "paper" | What the sheet is made of: its color token, tooth, shadow stack, default edge and printed rules. |
| edge | "cut" | "torn" | "deckle" | "crimp" | "zig" | "perf" | "scallop" | { top?, right?, bottom?, left? } | the stock's own | How it is cut. One kind, or one per side (missing sides are cut). Anything but `cut` cuts the sheet to a drawn outline; until it has a size the sheet shows as a cut CSS sheet. |
| tilt | boolean | number | true | true: a seeded angle within the stock's limit (never under a quarter of it, clamped to --ll-tilt-max, zero in calm density). A number is degrees. false lays it square. |
| rules | "none" | "ruled" | "ruled-hand" | "index" | "graph" | "dots" | "ledger" | "pad" | "window" | the stock's own | Printed rules on the sheet: blue lines and a red margin (`ruled` is gradients, `ruled-hand` is a light svg of wandering pencil lines), an index card's red header rule, graph cells, a dot grid, a ledger, an order pad's lines. One decorative element of CSS gradients; ruled stocks tilt less so text stays on the lines. Text sits on `ruled` (28 px pitch), `pad` and `index` (30) and `ledger` (24) rules when its line-height is the pitch and a line box ends where the first rule's line does (`ruled`: 16 px of padding, then 28 px lines): each rule is printed `--ll-rule-offset` above the bottom of its line box (default 8 px for `ruled`, 9 for `pad` and `index`, 6 for `ledger`), which is where a hand font's baseline leaves room for the rule to run 2 to 3 px under it. Set `--ll-rule-offset` on the sheet or any ancestor to tune it; the script role sits lower in its line box, lift it by the offset less about 3 px. |
| tape | "corner" | "top" | "both" | false | false | Tape strips across one top corner, along the top edge, or across both top corners. |
| tapeKind | TapeKind | "masking" | Which tape: masking, washi-dots, washi-stripes, washi-zigzag, washi-gingham, kraft, clear. |
| fastener | "clip" | "pin" | "staple" | "binder-clip" | false | false | Holds the sheet with a drawn prop that has a lit stroke and a short warm shadow. |
| fastenerTone | "steel" | "tomato" | "tangerine" | "lemon" | "grass" | "teal" | "sky" | "grape" | "bubblegum" | - | Color of the clip's plastic coating or the pin's head. |
| fastenerClassName | string | - | Classes for the fastener, merged after its default place (a clip stands at `-top-5 right-8`, a pin at `-top-2 left-1/2`), so `right-[3.125rem]` slides a clip along the top edge and `-top-8` lifts it. Use it to keep a fastener off a control at the sheet's corner. |
| shadow | "stock" | "none" | "hair" | "loose" | "lift" | "slip" | "card" | "pad" | "check" | "paper" | "sticky" | "stock" | The umber shadow stack. Calm density swaps it for a hairline. A drawn edge casts the stack's soft layers from a rectangle inset to the mean of its edge, and its tight layer as a hairline that follows the edge. |
| curl | boolean | false | A sticky note's curling bottom-right corner: the sheet is chamfered and the lifted flap is drawn into it, so it turns and casts with the sheet. |
| as | "div" | "section" | "article" | "aside" | "header" | "footer" | "main" | "nav" | "li" | "ul" | "ol" | "form" | "fieldset" | "figure" | "div" | The element to render. |
| seed | string | number | - | Pins the hand: the same seed always cuts, tilts and textures the sheet the same way. Default: derived from useId(). |
| size | [number, number] | - | The sheet's size in px, if you know it. A drawn edge is then part of the server markup instead of appearing after the first measure. |
A paper clip, push-pin, staple or binder clip as a free-standing prop. Intrinsic size, complete in server markup; place it with className.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| kind | "clip" | "pin" | "staple" | "binder-clip" | "clip" | Which fastener. |
| tone | "steel" | Accent | - | Clip coating or pin head color. |
| size | number | - | Clip height, pin head diameter, staple length or binder clip width in px. |
| seed | string | number | - | Pins the drawing. |
The paper tiles as SVG `<pattern>`s, for static svg art of your own that wants paper texture. A `Paper` needs none of it: torn, deckled and pinked sheets wear the tiles as CSS backgrounds, cached once per tile by the browser. Do not fill per-instance svgs with these patterns; every instance rasterizes its own copy.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| tiles | PaperTileName[] | fiber, relief, slip, kraft, cloud | Which tiles to define. |
CLI 会复制进你项目的文件。
正在加载源码