Modus UI

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.

Modus / Word Swarm

Installation

CLI

npx @modus-ui/cli add word-swarm

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/word-swarm.tsx.
  3. Paste the code.

Usage

tsx
import { WordSwarm } from "@/components/ui/word-swarm";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <WordSwarm />
    </div>
  );
}

Props

PropTypeDefaultDescription
textstring"Words gather meaning"Text to display (max 72 characters).
sizenumber1Text size multiplier (clamped 0.55–1.6).
opacitynumber1Overall opacity (clamped 0.1–1).
backgroundColorstringTheme --backgroundBackground colour, any CSS colour.
textColorstringTheme --muted-foregroundColour of untouched words.
activeTextColorstringTheme --foregroundColour of words the swarm touches.
particleColorstringTheme --primaryFill of the swarm's cells.
connectionColorstringTheme --primary, faintStroke of the links between cells.

Comments

  • No comments yet.