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.ReactNodeContent inside the book (pages).
titlestringTitle text displayed on the cover.
authorstringAuthor text displayed below the title.
spineTextstringText 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.ReactNodeIllustration or custom content on the cover.
widthnumberCustom width of the book (overrides preset).
heightnumberCustom height of the book (overrides preset).
animation"hover" | "none""hover"Controls interactive hover animation.
classNamestringAdditional CSS classes for styling.
...propsdiv propsAny other props passed to the root element.