BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/uselayouts/3d-book

3D Book

uselayouts/3d-book
FreeComponent

An interactive 3D book component with page flip animations.

Live preview

live · rendered by the registry
Rendered by uselayouts on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://uselayouts.com/r/3d-book.json

Source

registry/default/example/3d-book.tsxuselayouts.com/r/3d-book.json
1"use client";
2
3import { useRef, useState } from "react";
4
5export default function InteractiveBook() {
6 const bookRef = useRef<HTMLDivElement>(null);
7 const [progress, setProgress] = useState(0);
8 const [isDragging, setIsDragging] = useState(false);
9
10 // Linear interpolation function
11 const lerp = (a: number, b: number, t: number) => a + (b - a) * t;
12
13 const handlePointerMove = (e: React.PointerEvent<HTMLDivElement>) => {
14 if (!bookRef.current) return;
15
16 const rect = bookRef.current.getBoundingClientRect();
17 const cursorX = e.clientX;
18 const bookCenterX = rect.left + rect.width / 2;
19
20 // Calculate how far cursor is from center (-1 to 1)
21 const distanceFromCenter = (cursorX - bookCenterX) / (rect.width / 2);
22
23 // Map cursor position to progress
24 // Left side (negative) = open (1), Right side (positive) = closed (0)
25 const targetProgress = lerp(1, 0, (distanceFromCenter + 1) / 2);
26
27 // Clamp between 0 and 1
28 setProgress(Math.max(0, Math.min(1, targetProgress)));
29 };
30
31 const handlePointerDown = (e: React.PointerEvent<HTMLDivElement>) => {
32 setIsDragging(true);
33 handlePointerMove(e);
34 };
35
36 const handlePointerUp = () => {
37 setIsDragging(false);
38 setProgress(0);
39 };
40
41 const handlePointerLeave = () => {
42 // Close book when cursor leaves (only if not dragging on mobile)
43 if (!isDragging) {
44 setProgress(0);
45 }
46 };
47
48 // Generate pages - all at same size and position
49 const totalPages = 15;
50 const pages = [];
51
52 // All pages same size, different rotation angles
53 for (let i = 1; i <= totalPages; i++) {
54 const rotationAngle = (i + 1) * 10; // -20, -30, -40... -160
55
56 pages.push(
57 <div
58 key={i}
59 className="absolute h-48 md:h-72 w-32 md:w-52 rounded-lg md:rounded-2xl border border-border bg-background light"
60 style={
61 {
62 transformStyle: "preserve-3d",
63 transformOrigin: "left",
64 transform: `rotateY(calc(var(--book-progress) * ${-rotationAngle}deg))`,
65 zIndex: 50 + i,
66 backfaceVisibility: "visible",
67 "--book-progress": progress,
68 } as React.CSSProperties
69 }
70 />
71 );
72 }
73
74 return (
75 <div className="flex w-full h-full items-center justify-center ">
76 <div
77 ref={bookRef}
78 className="w-32 md:w-52 h-48 md:h-72 will-change-transform translate-x-16 md:translate-x-24 touch-none"
79 onPointerMove={handlePointerMove}
80// … truncated

What it pulls in

npm packages

  • motion
  • clsx
  • tailwind-merge

Files it writes

  • registry/default/example/3d-book.tsx

Facts

Registry
uselayouts
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

Docs on uselayouts uselayouts.com iurvish/uselayouts on GitHub Raw registry item This item as JSON

More from uselayouts

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Collectionanimated-collectionuselayoutsComponentsFree5 deps
Bento Cardbento-carduselayoutsComponentsFree5 deps
Bottom Menubottom-menuuselayoutsComponentsFree6 deps
BucketbucketuselayoutsComponentsFree5 deps · 2 files
Day Pickerday-pickeruselayoutsComponentsFree5 deps
Delete Buttondelete-buttonuselayoutsComponentsFree5 deps
Discover Buttondiscover-buttonuselayoutsComponentsFree5 deps
Discrete Tabsdiscrete-tabsuselayoutsComponentsFree3 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex