shadcn.io is not affiliated with official shadcn/ui
Paper Cut Text stacks a line on sheets of itself, as if each letter were cut from layered paper: every sheet below sits a step lower and a shade closer to the page, and one soft shadow glues them together. While the pointer is over it the stack tilts toward it, the deeper sheets shifting further, like a pop-up book.
Use it for an editorial headline, a portfolio, or a craft-themed page that should feel made by hands. For a single still shadow of lines, use Line Shadow Text; for a pressed, embossed look, Emboss Text. The top sheet is the real text and the others are copies in shades of its colour; the pointer writes two registered CSS properties that a transition eases, so the tilt springs without an animation library. With reduced motion it doesn't tilt.
Installation
Usage
import { PaperCutText } from "@/components/ui/paper-cut-text";<h1>
<PaperCutText text="Hand cut" />
</h1>Demos
Layers
layers is how many sheets lie under the top one, 4 by default: two read as a crisp two-tone cut, six or seven as a deep pop-up. tilt={false} holds the stack still.
Color
The sheets are shades between the text's colour and the page's: on a coloured surface, set --paper-cut-text-base to that surface's colour so the deeper sheets fade into it.
Accessibility
The top sheet is the real text, read once by screen readers and selectable; the sheets under it are copies hidden from them and from the pointer. The tilt answers a mouse or pen, not touch, and with reduced motion the stack stays still. In forced-colors mode the sheets are dropped.
FAQ
How are the sheets coloured?
Each is a mix of the text's colour and the page's background, more of the background the deeper it lies, so the stack recedes into the page in any theme. Set --paper-cut-text-base to fade them toward another colour.
Can the stack be deeper or flatter?
Yes: layers sets how many sheets there are, and --paper-cut-text-step how far each sits below the one above (0.03em); --paper-cut-text-reach is how far the deepest sheet shifts with the tilt (0.15em).
How does the tilt feel springy without a library?
The pointer writes its place over the text into two CSS properties registered as numbers, and a transition eases them, so the stack glides after the pointer and settles back when it leaves. Nothing renders again as it moves.
API Reference
PaperCutText
<span> data-slot="paper-cut-text"
textstring
The text.
layers?number
How many sheets lie under the top one. @default 4.
- Default
4
tilt?boolean
Whether the stack tilts toward the pointer while it's over the text, the deeper sheets shifting further, like a pop-up book.
- Default
true
render?ReactElement | ((props: object, state: object) => ReactElement)
Replace the host element or compose it with another component.
- Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string
Merged with the part's classes.
--paper-cut-text-basestring
The colour the deeper sheets fade toward (the page's background).
--paper-cut-text-reachstring
How far the deepest sheet shifts with the tilt (0.15em).
--paper-cut-text-stepstring
How far each sheet sits below the one above (0.03em).
Related
- Pro
Line Shadow Text
DecorativeA single still shadow of lines
- Pro
Handcrafted
Emboss Text
DecorativeA pressed, embossed look
- Pro
Paper Fold Text
EntrancePaper letters that unfold
- Pro
Turn it over
Tilt Text
InteractiveThe whole word tilts toward the pointer
- Pro
Stamp Text
EntranceLetters stamped on by hand
- Pro
Drop Cap Text
EntranceOpen an editorial page with a cap