Foundationper-character
Glitch Flicker
Per-character jitter and flicker — for cyber and dev-tool contexts.
Installation
Run the following command:
pnpmdlx shadcn@latest add https://mutype.dev/r/glitch-flicker.jsonProps
| Prop | Type | Default | Description |
|---|---|---|---|
| spec | AnimationSpec | — | Animation spec object (imported from components/mutype/specs/<id>). |
| text | string | — | The text to animate. |
| as | "span" | "div" | "h1"–"h4" | "p" | "span" | The HTML element to render. |
| triggerKey | string | number | — | Re-runs the animation when the value changes. |
| duration_multiplier | number | 1 | Scales duration_ms and stagger_ms uniformly. >1 slower, <1 faster. |
| y_travel_multiplier | number | 1 | Multiplier on y_px values; useful to dampen lift on small text. |
| forceReducedMotion | boolean | false | Forces the reduced-motion fallback even when the user has not opted in (testing). |
| onFinished | () => void | — | Fires once when the enter phase completes (not on cancel). |
| className | string | — | Tailwind / CSS class names. Forwarded to the host element. |
Usage notes
The pure spec animates opacity + jitter via stepped easing for a terminal feel. For a full RGB-split glitch, layer two CSS pseudo-elements with cyan and magenta text-shadow offsets that animate during enter (e.g., 2px/-2px chromatic split). Best on monospace or display fonts; can read as broken on long body copy. Pair with status-pulse for an AI 'unsettled' or 'hallucinating' cue. Avoid in critical confirmation flows — the visual instability undermines trust.
Inspired by Cyberpunk UI, terminal corruption, system-error aesthetics; a contained, tasteful version of CRT glitch..
