Modus UI

Letter Glitch

Web (React)

A canvas-rendered procedural matrix of glitching letters and symbols.

A highly-optimized canvas component that renders a dense grid of randomly fluctuating letters, smoothly transitioning between specified colors. Includes built-in center and edge vignette effects.

System Active

A purely canvas-rendered procedural glitch matrix.

Installation

CLI

npx @modus-ui/cli add letter-glitch

Manual

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

Usage

tsx
import { LetterGlitch } from "@/components/ui/letter-glitch";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full">
      <LetterGlitch
        glitchSpeed={50}
        centerVignette={true}
        outerVignette={true}
        smooth={true}
        glitchColors={["hsl(var(--primary))", "hsl(var(--primary))", "hsl(var(--primary))"]}
      />
    </div>
  );
}

Props

PropTypeDefaultDescription
glitchColorsstring[]["hsl(var(--primary))", "hsl(var(--primary))", "hsl(var(--primary))"]Colours the letters cycle through.
glitchSpeednumber50Milliseconds between glitch updates.
centerVignettebooleantrueDarkens the centre with a radial vignette.
outerVignettebooleantrueDarkens the edges with a radial vignette.
smoothbooleantrueFades between colours instead of switching instantly.
lightModebooleanfalseUses light-theme vignettes.
backgroundColorstring-Canvas background colour.
charactersstring"ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$&*()-_+=/[]{};:<>.,0123456789"Characters the grid is drawn from.

Comments

  • No comments yet.