Xzero UI
Pro library

Page curlPro

A small magazine you read by dragging page corners, with a real fold, lit curl, and flick to turn.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/page-curl
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/page-curl

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { PageCurl } from "@/components/xzero/page-curl/page-curl";

export function Lookbook() {
  return (
    <PageCurl
      label="Autumn lookbook"
      style={{ width: 540 }}
      pages={[<Cover key="cover" />, <Intro key="intro" />, <Plate key="plate" />]}
    />
  );
}

API reference

PageCurl

A small book or magazine that opens on its cover. On first view the cover corner curls up and settles next to a "Drag the corner" hint. Tap the right page to go forward and the left page to go back, or drag a page: it folds along a line that follows the pointer, showing its back, a lit curl, and a shadow on the page below. A page count with previous and next controls sits underneath.

PropTypeDefaultDescription
pages (required)ReactNode[]–Page contents in reading order. Page one is the cover and sits alone on the right.
spreadnumber–Controlled spread. 0 shows the cover; spread n shows pages 2n and 2n + 1 (one-based).
defaultSpreadnumber0Initial spread when uncontrolled.
onSpreadChange(spread: number) => void–Called when a page finishes turning.
pageAspectnumber0.72Page width divided by height.
labelstring"Book"Accessible name of the book.
teasebooleantrueCurls the cover corner once when the book first comes into view, and a little on hover until the first turn.
hintReactNode | null"Drag the corner"Hint under the lower outer corner, shown until the first interaction. Pass null to hide it.
controlsbooleantrueShows the page count with previous and next buttons under the book.
classNamestring–Extra class on the root. Its width holds two pages side by side.
styleCSSProperties–Inline styles on the root.

Keyboard interactions

KeysAction
ArrowRight / PageDownTurns to the next spread.
ArrowLeft / PageUpTurns to the previous spread.
TabMoves from the book to the previous and next page buttons.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in playful

Guidance for AI tools

Page curl: A small magazine you read by dragging page corners, with a real fold, lit curl, and flick to turn. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components