Page Peel
betaA surface whose corner peels back like a sticker to reveal what is underneath — hinted on hover, dragged, or toggled.
- Effects & motion
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add page-peelnpm packages installed: class-variance-authority.
import { PagePeel } from "@/components/ui/page-peel";Default
Corners
Primary Surface
<PagePeel>
| Prop | Type | Default |
|---|---|---|
revealContent (required)What the peel reveals underneath. | ReactNode | — |
children (required)The face of the page. | ReactNode | — |
cornerWhich corner lifts. Logical: | Corner | "bottom-end" |
defaultPeeledUncontrolled starting state. | boolean | false |
hoverAmountHow far the hover hint lifts, as a fraction of the full peel. Default 0.14. | number | 0.14 |
labelAccessible name of the corner button. Default "Peel back". | string | "Peel back" |
onPeeledChange | (peeled: boolean) => void | — |
peeledControlled: fully peeled. | boolean | — |
peelOnHoverCurl the corner a little on hover and focus. Default true. | boolean | true |
surface | "card" | "primary" | "card" |
Plus every attribute of <div> except children.
Peeling is a real toggle button at the lifting corner, named "Peel back" (or `label`) and exposed with aria-pressed, so it works by keyboard, touch and switch access, not only by dragging. The face peeled away is inert and aria-hidden, and the revealed content stays inert until it is revealed, so Tab never lands on something that cannot be seen. Hover and keyboard focus only hint with a small curl. Releasing a drag never also counts as a click. The corner is logical: `bottom-end` lifts at the bottom-left in right-to-left text. Every transition uses the duration tokens, so under reduced motion the peel is an instant swap.
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