Word Swarm
Web (React)
A gooey swarm of cells drifts over serif type and turns each word it touches to ink and italic.
A liquid, SVG-filtered swarm of cells wanders over a line of serif type, drawn toward the words and your pointer. Each word it touches darkens from muted ink to full foreground and leans into italic. Colours follow the active Modus theme and palette, and the type uses the heading font. It fills its positioned parent, pauses when off screen and renders a still frame when the user prefers reduced motion.
Installation
CLI
npx @modus-ui/cli add word-swarmManual
- Copy the code from the component tab.
- Create a file at
components/ui/word-swarm.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | "Words gather meaning" | Text to display (max 72 characters). |
size | number | 1 | Text size multiplier (clamped 0.55–1.6). |
opacity | number | 1 | Overall opacity (clamped 0.1–1). |
backgroundColor | string | Theme --background | Background colour, any CSS colour. |
textColor | string | Theme --muted-foreground | Colour of untouched words. |
activeTextColor | string | Theme --foreground | Colour of words the swarm touches. |
particleColor | string | Theme --primary | Fill of the swarm's cells. |
connectionColor | string | Theme --primary, faint | Stroke of the links between cells. |
Comments