Overview
Book3D uses CSS perspective and transformStyle: preserve-3d combined with Framer Motion to create a realistic 3D book. Hovering opens the cover, clicking pages flips through them sequentially, and leaving the component closes the book automatically. No Three.js or WebGL required.
Installation
Requires
framer-motion as a peer dependency.Usage
Props
URL of an image to use as the book cover background. If omitted, the default RareUI branding cover is shown.
Title text displayed on the cover in a large serif font.
Subtitle text displayed below the title on the cover in small uppercase tracking.
Book width in pixels.
Book height in pixels.
Array of page content objects. Defaults to a set of RareUI demo pages. Each
PageData object can contain:title?: string— Page headingcontent?: string— Body textimage?: string— Image URL displayed on the pagecaption?: string— Image caption (reserved for future use)quote?: string— Blockquote textauthor?: string— Quote attribution
Additional CSS classes applied to the outermost container.
Examples
Custom cover with title
Custom pages
Larger format
Interactions
| Gesture | Effect |
|---|---|
| Hover | Opens the book — cover flips left, body tilts in 3D |
| Click right page | Flips to the next page |
| Click left (flipped) page | Flips back to the previous page |
| Mouse leave | Book closes and resets to page 1 |
Features
CSS 3D Transform
Uses
perspective, transformStyle: preserve-3d, and rotateY to achieve a convincing 3D book effect without WebGL.Realistic Page Flip
Pages animate with a custom cubic bezier easing
[0.23, 1, 0.32, 1] and staggered delays for natural motion.Bi-directional Navigation
Click either side of an open page to advance or go back, with debounce protection against rapid clicking.
Fully Customizable
Override cover image, title, subtitle, dimensions, and all page content via props.