Book
betaA 3D book cover drawn in CSS that tilts, or swings open to reveal its first page, on hover and keyboard focus.
- Display
- 1 file
- 2 npm packages
- Accessibility notes
pnpm dlx @dowel-ui/cli add booknpm packages installed: class-variance-authority, radix-ui.
import { Book } from "@/components/ui/book";Default
Gallery
Open
With Illustration And Logo
As Link
<Book>
| Prop | Type | Default |
|---|---|---|
title (required)The title on the cover. | ReactNode | — |
colorCover colour. Any CSS colour; defaults to the primary token. | string | — |
effect | "tilt" | "open" | "none" | "tilt" |
illustrationArtwork for the colour band of the | ReactNode | — |
insideWhat the open cover reveals, for | ReactNode | — |
logoA mark at the foot of the cover. | ReactNode | — |
textColorTitle colour. Defaults to the foreground token (stripe) or primary-foreground (simple). | string | — |
variant | "stripe" | "simple" | "stripe" |
widthWidth in pixels; the height follows at 60:49. | number | 196 |
asChildRenders the child element as the book — typically a link. The book then takes keyboard focus itself, and focus opens or tilts it like hover does. | boolean | false |
Plus every attribute of <div> except title.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes