Folding Frame
betaA photo folded shut like a book in 3D — drag across it (or use the keys) to open the cover until it lies flat.
- Effects & motion
- 1 file
- 2 npm packages
- Accessibility notes
pnpm dlx @dowel-ui/cli add folding-framenpm packages installed: class-variance-authority, radix-ui.
import { FoldingFrame } from "@/components/ui/folding-frame";Default
Gallery
Controlled
Snap On Release
Right To Left
Disabled
<FoldingFrame>
| Prop | Type | Default |
|---|---|---|
alt (required)Describes the photo. It names the frame's role="img". | string | — |
src (required)Image URL of the photo. | string | — |
cornerCorner radius in px, 0–24. | number | 14 |
defaultValueUncontrolled starting openness. Defaults to 0: shut. | number | 0 |
depthPerspective, tilt and shadow strength, 0–100. | number | 55 |
disabled | boolean | false |
fill | "light" | "dark" | "light" |
labelAccessible name of the slider. | string | "Unfold" |
liquidStrength of the liquid hinge refraction (blur and warp), 0–100. | number | 60 |
onValueChangeCalled on every change: while dragging, per key press and on a release snap. | (value: number) => void | — |
onValueCommitCalled when an interaction ends: pointer released or key press. | (value: number) => void | — |
snapSettle fully open or shut when the pointer is released. | boolean | false |
thicknessSpine width and panel separation in px, 0–18. | number | 9 |
valueHow open the frame is, 0 (shut) to 100 (flat open). | number | — |
Plus every attribute of <div> except defaultValue, onChange, children.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes