Book

PreviousNext

A 3D styled, interactive book component with multiple variants and props.

book-default

book-thick

book-wide

Installation

pnpm dlx shadcn@latest add https://ui.dalim.in/r/styles/default/book.json

Usage

import { Book } from "@/components/ui/book"
 
<Book
  title="The Great Adventure"
  author="John Doe"
  spineText="Adventure"
  bookmark
  variant="hardcover"
  animation="hover"
>
  <p>This is some content inside the book.</p>
</Book>

API Reference

Book

Main container for the 3D styled book.

PropTypeDefaultDescription
childrenReact.ReactNode–Content inside the book (pages).
titlestring–Title text displayed on the cover.
authorstring–Author text displayed below the title.
spineTextstring–Text displayed on the book spine.
colorstring#555555Cover background color.
textColorstringcurrentColorText color for title and author.
bookmarkbooleanfalseShows a bookmark ribbon.
bookmarkColorstringredColor of the bookmark ribbon.
depthnumber5Depth (thickness) of the book spine.
variant"default" | "simple" | "hardcover" | "notebook""default"Style variant of the book.
illustrationReact.ReactNode–Illustration or custom content on the cover.
widthnumber–Custom width of the book (overrides preset).
heightnumber–Custom height of the book (overrides preset).
animation"hover" | "none""hover"Controls interactive hover animation.
classNamestring–Additional CSS classes for styling.
...propsdiv props–Any other props passed to the root element.