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/shapeshift

Usage

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

PropTypeDefaultDescription
textstring—The text
as"p" | "h1" | "h2" | "h3" | "h4" | "span" | "div""p"The element to render
durationnumber1.6Seconds the first letter shuffles before it lands
staggernumber0.14Seconds between one letter landing and the next
ratenumber8Typeface swaps per second while shuffling
order"left" | "random""left"Letters land left to right, or in a random order
delaynumber0Seconds before it starts
hoverbooleantrueShuffle 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