Components

Page

The app's main paper column: a sheet on the desk with a header, content and a footer. It can be three-hole punched (the desk shows through the holes), torn from a pad, ringed with a coffee stain, and its title is underlined by the same hand that wrote it.

Install

terminal
npx shadcn@latest add @wobko/page

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

Examples

A page

Header, content and footer on a sheet of paper. The title is underlined by hand; the column is centered and as wide as you say.

Punched, ringed, stained

`holes` punches three holes down the start edge (or two across the top); the desk shows through. `reinforced` adds gummed rings, `stain` a coffee ring.

Torn from a pad

`torn` is a shorthand for the edge. Pair it with a slip, a highlighted title and a tape strip.

A weekly review

A real page: three-hole punched, a form on it, a sticker stuck to the corner. Everything on the sheet is ordinary, accessible DOM.

API reference

Page

A Paper laid out as a centered flex column (gap 6, px 6 / 10, py 8 / 10). It takes every Paper prop; the holes and the stain are ink behind the content, turned with the sheet. The holes' drawing is exactly the page's box (it adds no bleed of its own); but a page that fills the window is turned by up to 0.35 degrees and its far corners swing a few px past the window's edge, so give a full-width page a container with `overflow-x-clip` (and 8 px of side padding, which keeps its shadow) or lay it square with `tilt={false}`.

PropTypeDefaultDescription
as"div" | "main" | "article" | "section" | "form""div"The element. Use `main` when the page is the app's main landmark.
width"sm" | "md" | "lg" | "xl" | "full""md"Column width: 32rem, 42rem, 56rem, 72rem or unbounded. Always centered.
holes"start" | "top" | "none" | booleanfalsePunched holes: three down the start edge (mirrored for right-to-left), or two across the top. `true` is `start`. The desk shows through them; the start padding grows to clear them.
reinforcedbooleanfalseGummed reinforcement rings round the holes.
stainbooleanfalseA coffee ring in the lower corner (multiply-printed, faint).
tornboolean | "top" | "bottom" | "both"-Shorthand for a torn edge. `edge` wins if both are given.
stockStockName"paper"Any Paper stock: paper, slip, graph, dot-grid, kraft, parchment ...
rulesRuleName"none"Printed rules (ruled, graph, dots ...). Ruled paper's red margin mirrors in RTL.
tiltboolean | numbertrueSeeded turn of the sheet (under 0.35 degrees for a page). The holes turn with it; text never does.
tape / fastenerPaper props-Tape it or clip it down, like any sheet.
seedstring | number-Pins the hand: tilt, holes, stain.

PageTitle

The title, a heading in the script font (41 px). A hand-drawn mark sits under it.

PropTypeDefaultDescription
as"h1" | "h2" | "h3" | "p" | "div""h1"The element.
underline"single" | "double" | "wavy" | "highlight" | "none""single"A pen line, two, a wavy one, or a yellow highlighter swipe behind the lower half of the words. Calm density draws a hairline.
seedstring | number-Pins the hand of the mark.

Accessibility

  • Page is a plain element (`div` by default): pass `as="main"` for the main landmark, or `as="article"` / `"section"` with a label when it means something.
  • PageTitle is a real heading (`h1` by default); its mark, the holes, rings, stain, tape and fasteners are aria-hidden, pointer-events-none decoration.
  • Ink on paper is 14:1 and the muted description 8.9:1. The tilt is zero in calm density, and Windows high contrast replaces the drawing with a real outline.
  • The start padding grows with `holes` so text never reaches the punch; right-to-left pages get their holes and margin rules on the right.

Source

The files the CLI copies into your project.

Loading the source