Overview
Glitch text effects stack two aria-hidden RGB-shifted decoys behind a readable base text node and animate clip-path: inset() bands on the decoys at staggered intervals. The base stays legible at all times; the decoys do the visual work of dropouts, scanlines, and flickers. Three cadences ship: a short edge flicker, an ambient scanline drift, and an aggressive dropout stutter.
When to use it
Reach for glitch text on cyberpunk product surfaces, error states, retro-tech accents, hero headlines that want to feel unstable on purpose. Skip it for body copy — the flicker is exhausting at reading speed. Skip it for accessibility-critical content (error messages, form validation) — users with photosensitive epilepsy can be triggered by rapid flicker.
How it works
Three identical text nodes stack at the same position. The base is normal color; one decoy gets color: cyan + translateX(-1.2px); the other gets color: magenta + translateX(1.2px). mix-blend-mode: screen on the decoys lightens the result where they overlap, simulating an RGB sub-pixel offset. Each decoy then animates a clip-path: inset(top right bottom left) with bands at staggered y-positions so only horizontal slices of the decoy show at a time — the “glitch slice” effect. Synchronizing the bands at different cycles makes the noise feel non-repeating.
Production gotchas
The base text must be position: relative with the decoys at position: absolute; inset: 0; absolute positioning on the decoys is what lets clip-path slice them without affecting the base. Decoys must be aria-hidden="true" or screen readers announce the text three times. Strobe rates above 3Hz can trigger photosensitive epilepsy — never set the flicker keyframe steps shorter than 333ms, and gate the whole effect behind a user preference for high-intensity variants.
Accessibility
WCAG 2.3.1 (Three Flashes) is the load-bearing constraint here. Under prefers-reduced-motion: reduce hide the decoys entirely (display: none or opacity: 0) so motion-sensitive users see only the static base text. The base text is the only real DOM node screen readers process; the decoys add nothing semantic.
References