Book 3D

A 3D interactive book component that rotates on hover.

Build Something Rare

Join thousands of developers creating stunning interfaces with RareUI. Your next project deserves components that stand out.

6
Notes

Getting Started

Install any component with a single command: npx rareui@latest add [component-name]. No configuration needed, just beautiful components ready to go.

5
Notes
"Great design is not just what looks good. It also needs to perform, convert, and amaze."
- RareUI Philosophy
4
Notes

Premium Components

From glass-morphic buttons to 3D cards, each component is designed with attention to detail. Self-contained, easy to install via CLI, and ready to use.

3
Notes
Page visual
2
Notes

Welcome to RareUI

A premium collection of beautifully crafted, animated React components. Built with Motion and Tailwind CSS for modern web applications.

1
Notes

RareUI

Premium Component Library

Beautifully crafted React components with stunning animations

Built with Motion & Tailwind CSS

Easy installation via CLI

RareUi

Installation

pnpm dlx rareui add book-3d

Usage

Usage

1

Import the component

import { Book3D } from '@/components/rareui/3d-elements/book-3d';
2

Use in your application

export default function App() { return <Book3D />; }

Examples

Examples

1

Custom Cover

<Book3D src="/my-book-cover.jpg" title="My Awesome Book" subtitle="By John Doe" />
2

Custom Pages

const customPages = [ { title: "Introduction", content: "Welcome to my book. This is the first page with an introduction." }, { image: "/illustration.jpg", caption: "A beautiful illustration" }, { title: "Chapter 1", content: "The story begins here..." }, { quote: "Design is not just what it looks like and feels like. Design is how it works.", author: "Steve Jobs" } ]; <Book3D src="/cover.jpg" title="My Book" pages={customPages} />
3

Fully Customized

<Book3D src="/fantasy-cover.jpg" title="The Chronicles" subtitle="An Epic Tale" width={250} height={380} pages={myCustomPages} className="shadow-2xl" />

Features

Hover to open, click pages to flip.

Interactions

  • Hover → Book opens (cover flips to the left)
  • Click right page → Flip to next page
  • Click left page → Flip back to previous page
  • Mouse leave → Book closes automatically

Tips

  • Keep content text concise (50-100 words) for best readability
  • Use high-quality images with good contrast for the cover
  • Limit pages to 4-6 for optimal user experience
  • The book resets to page 1 when closed

Props

Props

PropTypeDefaultDescription
srcstring-Cover image URL. If not provided, shows RareUI branding.
titlestring-Title displayed on cover.
subtitlestring-Subtitle displayed on cover.
pagesPageData[][...]Array of page content objects. Defaults to RareUI demo pages.
widthnumber230Book width in pixels.
heightnumber350Book height in pixels.
classNamestring-Additional CSS classes for the container.

PageData Interface

Each page in the pages array can have the following properties:

interface PageData {
  title?: string      // Page title
  content?: string    // Main text content
  image?: string      // Image URL
  caption?: string    // Image caption (not currently used)
  quote?: string      // Blockquote text
  author?: string     // Quote attribution
}

Page Types

You can create different types of pages:

Text Page:

{
  title: "Chapter 1",
  content: "Your text content here..."
}

Image Page:

{
  image: "/path/to/image.jpg",
  caption: "Optional caption"
}

Quote Page:

{
  quote: "The only limit is your imagination.",
  author: "Unknown"
}

Mixed Content:

{
  title: "Chapter 2",
  content: "Some text...",
  image: "/image.jpg"
}