Pro
Book shelf
A shelf of documents as spines. Width follows the page count, so a dozen fit in a row and scan like a list. Hover or focus tugs a spine up by its top; choosing one takes it off the shelf, its neighbours lean into the gap, and the book swings round beside the shelf to show its cover, page edge and details.
pnpm dlx shadcn@latest add @caliper/book-shelfWhen to use
Use it for
- A library of runbooks, handbooks or reports where people browse before they open.
- Showing how much there is and who owns it, with one document inspected at a time.
Skip it when
- Search results or anything people filter by text; use a list or a table.
- More than about twenty documents; the shelf scrolls sideways and loses its overview.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- One tab stop, arrows between spines
- The shelf is a list of toggle buttons. Left, Right, Home and End move, Enter or Space pulls a book out, Escape puts it back, and each spine is named with title, author and page count.
- A taken book leaves its slot
- The chosen spine becomes an outline the size of the book, so you can see where it goes back and press it to return it. Its neighbours lean into the gap, and the row never reflows.
Styling
- Cloth, not colour coding
- Spines use a few muted cloth tones with a rounded sheen and headbands so they read as objects. Tone never carries meaning; the cover writes everything out.
- Spine height only separates neighbours
- Height varies by a few steps so twelve spines read as separate objects. It never encodes a value; width is the only measure, and the cover writes the numbers out.
Installation
pnpm dlx shadcn@latest add @caliper/book-shelf
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { BookShelf } from "@/components/ui/book-shelf"
The worked example comes with Pro
The 40-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
BookShelf
component
Accessibility
It is built on native elements and keeps aria-label, aria-pressed, aria-hidden and aria-live in step with state. Changes that matter are announced through a live region.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- BookletA short ordered read, turned page by page: release highlights, a tour, a report. Turning a page moves it from the pile you have not read to the pile you have, so the piles show how far through you are while the counter tells you exactly.
- CarouselA swipeable row of slides with controls and dots.
- Cover flowAlbum-style covers that flip through in 3D.