Components

Notebook

An open notebook on the desk: ruled paper with a red margin, bound with a wire spiral, binder rings or a stab-stitched spine, its holes punched, more pages peeking out underneath. Text sits on the lines, and with a dog-ear it turns pages. Its closed sibling, `NotebookCover`, is a cloth-bound cover with a stitched spine and an elastic band.

Install

terminal
npx shadcn@latest add @wobko/notebook

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

Examples

A spiral notebook

Wire coils through punched holes, ruled lines with a red margin, and two more pages peeking out underneath. The words sit on the lines.

Four bindings

A wire spiral, binder rings, a stab-stitched spine in tomato thread, and a reporter's pad bound on top. Each is a different drawing; the holes are punched through and the desk shows in them.

Turning pages

`curl` folds the corner and `NotebookTurn` is the button over it. Pages are named with `value`; only the current one is shown, and a turned page unfolds from the dog-ear (a clip-path wipe, no 3D).

A packing list

A real notebook page: one checkbox per ruled line (each row is exactly 28 px, so the boxes and words sit on the lines), and a sticker stuck to the corner.

On the shelf

The closed notebook: cloth over board, a darker spine stitched to it, an elastic band, and a paper label. Any stationery color, or black.

API reference

Notebook

A Paper (ruled by default) with the binding drawn over its start edge. Content sits on a 28 px rhythm (`leading-7`; 24 px in calm density; 30 px bound on top): the first line box ends where the first rule's line does, and the rules are printed `--ll-rule-offset` above the foot of each line box, so words stand 2 to 3 px above their rule. Room for the binding and the margin on the start side. It takes every Paper prop.

PropTypeDefaultDescription
binding"spiral" | "rings" | "stitched" | "none""spiral"A wire spiral (a coil per 24 px, each through its own hole), three binder rings on a steel strip, a stab binding with a running thread, or nothing.
side"start" | "top""start"Which edge is bound. `start` is the left in LTR and mirrors in RTL; `top` is a reporter's pad (30 px pad rules, no margin).
pages0 | 1 | 2 | 32Sheets peeking out under this one at its foot and far edge.
tone"steel" | Accent"steel"Color of the wire (or of the thread for a stitched binding; steel then uses blue thread).
rulesRuleName"ruled" ("pad" when bound on top)Printed rules: ruled, graph, dots, pad, none ... The margin and the rules mirror in RTL.
curlbooleanfalseFold the bottom-right corner (a dog-ear). Pair it with `NotebookTurn`.
value / defaultValue / onValueChangestring-Which `NotebookPage` is shown, when the notebook has several. Controlled or not.
stock / edge / tape / fastener / tilt / seedPaper props-As on any sheet.

NotebookPage

One page of writing (a `section`). With a `value`, only the current page is shown (the others are `hidden`), and a page that is turned to unfolds from the dog-ear in the bottom-right corner (a clip-path wipe, no 3D; not for the page that is there at load; none with reduced motion).

PropTypeDefaultDescription
valuestring-The name of this page. A page without one is always shown.

NotebookTurn

A button over the folded corner (34 px, always bottom right, as the fold is; it sits above the page content, so keep buttons and links out of that corner). Its content is its accessible name; the default is "Turn the page".

PropTypeDefaultDescription
tostring-The page to turn to.
asChildbooleanfalseRender your own element (a link, say) as the corner.

NotebookCover

The cover of a closed notebook, for a shelf or a library: cloth over board with a darker stitched spine on the start edge and an elastic band round the end. One drawn sheet, tilted and shadowed as one; 11 x 15 rem by default. The label goes in as children and sits in a body laid over the cover (its padding is a share of the COVER's width, whatever holds the shelf). Until it is measured it wears a plain card.

PropTypeDefaultDescription
toneAccent | "ink""tomato"The cloth: any stationery color, or `ink` for black.
bandbooleantrueThe elastic band.
tilt / seed / sizeboolean | number / string | number / [w, h]-A seeded turn under 1.4 degrees; pins the hand; the box in px for server-rendered drawings.

Accessibility

  • A Notebook is a plain element (`div`; `as="section"`, `"article"` or `"figure"` with a label when it means more). The binding, holes, pages underneath and the fold are aria-hidden, pointer-events-none decoration.
  • `NotebookTurn` is a real button (Enter and Space), named by its content; pages that are not current are `hidden`, so a screen reader reads only the open page. Give the button a name that says where it goes ("Next: Tuesday").
  • Text is ink on paper (14:1). The tilt is under 0.3 degrees and zero in calm density. Calm density also drops the wobble of the ruled lines' hand-drawn variants.
  • Block spacing in multiples of 1.75rem (28 px) keeps text on the lines; margins that break the rhythm are yours to choose.

Source

The files the CLI copies into your project.

Loading the source