A field of characters woken by a trail of light and rings.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/glyph.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/glyph.json
Turn on the motion
npx @prequelui/cli@latest animate glyphThe CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.
Usage
Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.
import { GlyphBackground } from "@/components/prequelui/backgrounds/glyph";
export default function Demo() {
return (
<div className="relative h-96 overflow-hidden rounded-xl">
<GlyphBackground />
</div>
);
}import { Glyph } from "@/components/prequelui/glyph";
export function Variant() {
return (
<Glyph tempo={1.2}>
…
</Glyph>
);
}Animation
A field of characters is mostly asleep. Moving the pointer leaves a trail that lights the nearby glyphs, and a click sends an expanding wave through the grid; the accents switch colour where the wave is strongest.
- Cells are 11 px glyphs on a 1.35 line height, redrawn at 30 fps.
- The trail keeps the last 12 points for 700 ms and decays quadratically.
- Waves expand for 4 s with a 10 px edge and a 560 px front.
- Reduced motion draws the resting field with no trail and no waves.
API Reference
Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.
GlyphBackground
| Prop | Type | Default |
|---|---|---|
| interactive | boolean | true |
| fontSize | number | 11 |
| glowColor | string | undefined | foreground |
| shapeColor | string | undefined | cyan |
| speed | number | 1 |
| paused | boolean | false |
| className | string | — |