Skip to main content

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

string
URL of an image to use as the book cover background. If omitted, the default RareUI branding cover is shown.
string
Title text displayed on the cover in a large serif font.
string
Subtitle text displayed below the title on the cover in small uppercase tracking.
number
default:"230"
Book width in pixels.
number
default:"350"
Book height in pixels.
PageData[]
default:"[...RareUI demo pages]"
Array of page content objects. Defaults to a set of RareUI demo pages. Each PageData object can contain:
  • title?: string — Page heading
  • content?: string — Body text
  • image?: string — Image URL displayed on the page
  • caption?: string — Image caption (reserved for future use)
  • quote?: string — Blockquote text
  • author?: string — Quote attribution
string
Additional CSS classes applied to the outermost container.

Examples

Custom cover with title

Custom pages

Larger format

Interactions

Keep content text under 100 words for best readability at the default size. Limit pages to 4–6 for optimal UX — too many pages makes navigation tedious.

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.