book-default
import { DalimYellowIcon } from "@dalim/core/components/logo"
import { Book } from "@/components/ui/mockups/book"
export function Component() {
return (
<div className="flex h-full items-center justify-center">
<Book author="Ali" textColor="white">
<div className="space-y-2 pl-3 text-white">
<DalimYellowIcon />
<h1 className="pt-2 text-3xl leading-7 font-semibold">
Learn <br /> Designs
</h1>
<p className="text-xs leading-3 opacity-70">
A Practical Handbook for Visual Consistency & Creativity
</p>
</div>
</Book>
</div>
)
}
pnpm dlx shadcn@latest add "https://ui.dalim.in/r/book-default.json"
book-thick
100p
import { DalimBlackIcon } from "@dalim/core/components/logo"
import { Book } from "@/components/ui/mockups/book"
export function Component() {
return (
<div className="flex h-full items-center justify-center">
<Book depth={8} color="#fff200" variant="notebook" textColor="black">
<div className="mt-8 space-y-2 text-center text-black">
<div className="flex justify-center">
<DalimBlackIcon />
</div>
<h1 className="pt-2 text-2xl leading-6 font-bold tracking-tighter">
Designs <br /> That Gives
</h1>
<p className="mt-2 text-xs leading-3 opacity-70">
A Practical Handbook for Visual Consistency & Creativity
</p>
</div>
</Book>
</div>
)
}
pnpm dlx shadcn@latest add "https://ui.dalim.in/r/book-thick.json"
book-wide
import { DalimBlackIcon } from "@dalim/core/components/logo"
import { Book } from "@/components/ui/mockups/book"
export function Component() {
return (
<div className="flex h-full items-center justify-center">
<Book
author="Ali"
variant="notebook"
color="white"
depth={8}
pages={200}
height={204}
width={300}
orientation="landscape"
textColor="black"
>
<div className="-mt-4 space-y-2 text-center text-black">
<div className="flex justify-center">
<DalimBlackIcon />
</div>
<h1 className="pt-2 text-3xl leading-8 font-bold tracking-tighter">
Designs <br /> That Gives
</h1>
<p className="mt-2 px-10 text-xs leading-3 opacity-70">
A Practical Handbook for Visual Consistency & Creativity
</p>
</div>
</Book>
</div>
)
}
pnpm dlx shadcn@latest add "https://ui.dalim.in/r/book-wide.json"
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.
Prop | Type | Default | Description |
---|---|---|---|
children | React.ReactNode | – | Content inside the book (pages). |
title | string | – | Title text displayed on the cover. |
author | string | – | Author text displayed below the title. |
spineText | string | – | Text displayed on the book spine. |
color | string | #555555 | Cover background color. |
textColor | string | currentColor | Text color for title and author. |
bookmark | boolean | false | Shows a bookmark ribbon. |
bookmarkColor | string | red | Color of the bookmark ribbon. |
depth | number | 5 | Depth (thickness) of the book spine. |
variant | "default" | "simple" | "hardcover" | "notebook" | "default" | Style variant of the book. |
illustration | React.ReactNode | – | Illustration or custom content on the cover. |
width | number | – | Custom width of the book (overrides preset). |
height | number | – | Custom height of the book (overrides preset). |
animation | "hover" | "none" | "hover" | Controls interactive hover animation. |
className | string | – | Additional CSS classes for styling. |
...props | div props | – | Any other props passed to the root element. |