Shapeshift
Text that can't decide what it is. Every letter flickers through a stack of very different typefaces before it lands in your own font.
Shapeshift
Props
Order
Duration1.60
Stagger0.14
Rate8
Installation
pnpm dlx shadcn@latest add @breeze/shapeshiftUsage
import { Shapeshift } from "@/components/breeze/shapeshift"It works best on a short, large word or title. It lands in whatever font the element already has, so style it like any other text.
<Shapeshift as="h1" text="Shapeshift" className="text-7xl font-semibold tracking-tight" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | — | The text |
as | "p" | "h1" | "h2" | "h3" | "h4" | "span" | "div" | "p" | The element to render |
duration | number | 1.6 | Seconds the first letter shuffles before it lands |
stagger | number | 0.14 | Seconds between one letter landing and the next |
rate | number | 8 | Typeface swaps per second while shuffling |
order | "left" | "random" | "left" | Letters land left to right, or in a random order |
delay | number | 0 | Seconds before it starts |
hover | boolean | true | Shuffle again when the pointer comes over it |
trigger | "view" | "mount" | "view" | Start when it scrolls into view, or as soon as it mounts |
Each letter flickers through ten faces: blackletter, pixel, script, a fat Didone, a condensed poster face, a lined display face, a wide grotesk, two monos and an italic serif. It flickers in a cell the size of its final glyph, so the line never shifts. The faces load lazily, so they cost nothing until it plays. Screen readers get the plain text, and with reduced motion it shows the text straight away.
Examples
Random order
Mischief
<Shapeshift
order="random"
duration={1.2}
stagger={0.18}
text="Mischief"
className="text-6xl font-semibold tracking-tight"
/>