Skip to content
Signature

GlitchText

Per-character scramble/decode headline over a persistent ambient signal-noise field — resolves on hover, in-view, or as a continuous pulse (reduced-motion aware).

● LIVE
System OnlineDecodes on view; ambient signal-noise keeps churning behind it
Signal HUDHover to re-run the decode
Signal LockContinuous pulse — re-scrambles on a loop
Ghost Modeambient={false} — plain heading, decode on hover only
npx shadcn@latest add https://okibi.cndr.dev/r/glitch-text.json

Installation

Install the theme first, then add the component:

npx shadcn@latest add https://okibi.cndr.dev/r/glitch-text.json

Copy the source from the Code tab above into components/ui/glitch-text.tsx. It uses the cn helper and the okibi theme tokens — install the theme first if you haven't.

Usage

import { GlitchText } from "@/components/ui/glitch-text"

<GlitchText trigger="hover">DECODING SIGNAL</GlitchText>

Examples

Triggers

trigger controls when the decode runs — hover to resolve on pointer-in, view on scroll-into-view, or always for a continuous pulse.

● LIVE
trigger // hoverSignal HUD
trigger // viewSystem Online
trigger // alwaysSignal Lock

Tuning

Tune the decode with a custom glyphs pool, a slower speed and a wider stagger on an always headline.

● LIVE
glyphs // speed // stagger

Decode Sequence

API Reference

GlitchText

PropTypeDefaultDescription
trigger"hover" | "view" | "always""hover"What drives the decode reveal.
ambientbooleantruePersistent ghost-noise field behind the text.
glyphsstring░▒▓█▚▞01<>/\\|=+*#%·:.—Glyph pool the characters churn through. Defaults to a built-in block / box-drawing set (░▒▓█▚▞ plus digits and ASCII symbols).
speednumber420Per-character resolve window, in ms.
staggernumber55Per-character stagger, in ms.
asElementType"span"Render element.

Accessibility

  • The resolved text is the real accessible content: it lives in a single sr-only node, so assistive tech reads it once, cleanly, and never the scramble.
  • The ambient ghost-noise field and the decode overlay are both aria-hidden, so the churn is never announced.
  • Under prefers-reduced-motion the effect is skipped and the plain, fully-resolved text renders static.
  • Randomness runs only post-mount, so the server and first client render both show the resolved text — no hydration mismatch.
  • The default hover trigger fires on pointer enter/leave only; for keyboard or touch reach prefer trigger='view' or trigger='always', and note [data-glitching] is exposed while a reveal runs.

Guidelines

Do

  • Use it for short decoding-terminal headlines and wordmarks where a live, signal-noise identity is wanted.
  • Choose the trigger for context: 'hover' for pointer reveal, 'view' for a scroll-in decode, 'always' for a continuous pulse.
  • Tune the feel with glyphs, speed and stagger, and target [data-glitching] for run-scoped styling.

Don't

  • Do not rely on hover to expose meaning — the resolved text is always present for assistive tech, but the visible decode is pointer-only.
  • Do not run it on long paragraphs; the per-character scramble is built for short headline-length strings.

On this page