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

Run the following command to install the component:

npx rareui add book-3d

This will install the component to components/rareui/ directory.

Usage

The Book3D component is fully customizable with smart defaults. Use it out-of-the-box or customize every aspect.

Basic Usage (Default)

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

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

This displays a beautiful RareUI-branded book with 6 pre-filled pages about RareUI.

Custom Cover

Add your own cover image and title:

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

Custom Pages

Define your own page content:

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}
/>

Fully Customized

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

Props

PropTypeDefaultDescription
srcstringundefinedCover image URL. If not provided, shows RareUI branding.
titlestringundefinedTitle displayed on cover.
subtitlestringundefinedSubtitle displayed on cover.
pagesPageData[][...]Array of page content objects. Defaults to RareUI demo pages.
widthnumber230Book width in pixels.
heightnumber350Book height in pixels.
classNamestringundefinedAdditional 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"
}

Features

  • Interactive 3D Animation: Hover to open, click pages to flip
  • Realistic Physics: Smooth page-turning animations with natural easing
  • Bi-directional Navigation: Click right to advance, click left to go back
  • Smart Defaults: Beautiful RareUI branding when no customization provided
  • Fully Customizable: Override cover, title, and all page content
  • TypeScript Support: Full type safety with defined interfaces
  • Responsive: Configurable dimensions to fit your layout

Interactions

  1. Hover → Book opens (cover flips to the left)
  2. Click right page → Flip to next page
  3. Click left page → Flip back to previous page
  4. 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