- Docs
- Components
- 3D & Shaders
- Page Flip
Page Flip
A book-style page flip you can drag through
Customize
Props
18| Name | Type | Default | Description |
|---|---|---|---|
pages | PageFlipLeaf[] | 5 leaves | Leaves of the book. Each entry takes front, back, optional alt text and an id. |
pageWidth | number | 220 | Width of a single leaf in pixels. |
pageHeight | number | 320 | Height of a single leaf in pixels. |
pageRadius | number | 4 | Corner radius of a leaf in pixels. |
pageColor | string | "#f4f4f4" | Paper colour showing through while an image loads. |
perspective | number | 1200 | Perspective depth of the scene. Lower values exaggerate the turn. |
spineShift | number | 110 | How far the book slides aside once a leaf is turned. |
turnAngle | number | 180 | Angle a turned leaf rotates through, in degrees. |
peekAngle | number | 10 | Angle an unopened leaf tilts to when the pointer is over it. |
duration | number | 0.55 | Seconds a single turn takes. |
stagger | number | 0.08 | Seconds added per leaf when the whole book closes at once. |
ease | "easeInOut" | "easeOut" | "circOut" | "backOut" | "easeInOut" | Easing curve of the turn. |
shadow | number | 0.3 | Drop shadow strength behind each leaf. Set to 0 to remove. |
trigger | "click" | "hover" | "click" | Interaction that turns a leaf. Hover riffles through the book. |
closeOnLeave | boolean | true | Close every turned leaf when the pointer leaves the scene. |
interactive | boolean | true | Enable pointer and keyboard interaction. |
className | string | - | Optional className applied to the root. |
style | CSSProperties | - | Optional inline style applied to the root. |
pagesPageFlipLeaf[]Leaves of the book. Each entry takes front, back, optional alt text and an id.
5 leavespageWidthnumberWidth of a single leaf in pixels.
220pageHeightnumberHeight of a single leaf in pixels.
320pageRadiusnumberCorner radius of a leaf in pixels.
4pageColorstringPaper colour showing through while an image loads.
"#f4f4f4"perspectivenumberPerspective depth of the scene. Lower values exaggerate the turn.
1200spineShiftnumberHow far the book slides aside once a leaf is turned.
110turnAnglenumberAngle a turned leaf rotates through, in degrees.
180peekAnglenumberAngle an unopened leaf tilts to when the pointer is over it.
10durationnumberSeconds a single turn takes.
0.55staggernumberSeconds added per leaf when the whole book closes at once.
0.08ease"easeInOut" | "easeOut" | "circOut" | "backOut"Easing curve of the turn.
"easeInOut"shadownumberDrop shadow strength behind each leaf. Set to 0 to remove.
0.3trigger"click" | "hover"Interaction that turns a leaf. Hover riffles through the book.
"click"closeOnLeavebooleanClose every turned leaf when the pointer leaves the scene.
trueinteractivebooleanEnable pointer and keyboard interaction.
trueclassNamestringOptional className applied to the root.
-styleCSSPropertiesOptional inline style applied to the root.
-