Skip to content
Textlab
1
Browse

ComponentsTyping

Matrix decode

Glyph rain resolves into the word.

Signal acquired

Installation

$ npx shadcn@latest add @textlab/matrix-decode

Needs @textlab in your components.json. Setup takes a minute.

Usage

usage.tsx
import { MatrixDecode } from "@/components/textlab/matrix-decode/matrix-decode";

<MatrixDecode as="h2" text="Wake up" />

Variants

rainflicker

Props

PropTypeDefaultDescription
text*string–The copy.
variant"rain" | "flicker""rain"rain drops a column of glyphs onto each letter; flicker cycles glyphs in place.
glowstringphosphor greenColor letters flash as they lock in.
charsetstringhalf-width katakana and digitsGlyphs used in the rain.
asElementType"span"Rendered element.
trigger"mount" | "inView" | "hover" | "manual""inView"What starts the animation. manual follows `active`.
activebooleanfalseDrives trigger="manual".
oncebooleantrueIn view: play once instead of on every entry.
delaynumber0Seconds before the first part moves.
durationnumber1.6Seconds each part takes.
reducedMotion"user" | "always" | "never""user"user follows the OS setting; always shows the still version.
classNamestring–Merged onto the root.

When to use it

Reach for it

  • Developer tools, terminals and security products.
  • Short titles on dark backgrounds.

Skip it

  • Light, calm brands; the glow reads loud.
  • Paragraphs.

Accessibility and motion

Accessibility

  • The rain is decorative and aria-hidden; the title is read once.
  • Glyph positions are seeded, so server and client render the same frame.

Motion

  • Each letter catches its column just as it lands, then cools from the glow color over 0.9 s.
  • Order is loosely left to right, with seeded randomness.
Reduced motion. The title appears in place with no rain or glow.

Performance

  • One short motion per letter; nothing runs after it resolves.