Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/developer-exe/llms.txt
Use this file to discover all available pages before exploring further.
GlitchText produces the chromatic-aberration glitch effect seen on headings and labels throughout developer.exe. The component renders a wrapper <span class="glitch-wrapper"> around the target element, sets data-text to the provided string so CSS pseudo-elements can mirror the content, and toggles between an always-on and hover-only animation mode based on the interactive prop. The glitch itself is driven entirely by CSS — no JavaScript animation libraries are involved.
Props
The text string to display and animate. This value is rendered as the element’s children and also written to the
data-text DOM attribute, which the CSS ::before and ::after pseudo-elements read via content: attr(data-text) to create the offset ghost layers.The HTML element tag to render. Pass any valid tag name —
"h1", "h2", "p", "div", "span" — to control the semantic role of the glitched text in your document hierarchy.Additional CSS or Tailwind classes applied to the outer
.glitch-wrapper span. Use this for typography scale, colour, spacing, or layout adjustments.When
false (default), the glitch animation runs continuously. When true, the glitch activates only while the user’s pointer hovers over the element — useful for navigation links or CTAs where a permanent glitch would be visually noisy.Always-on glitch
Use the defaultinteractive={false} behaviour for section headings and decorative labels that should glitch continuously as soon as they mount:
Interactive (hover-only) glitch
Passinteractive to restrict the effect to the hover state. The element renders as plain text until the pointer enters, at which point the glitch-text-base animation class is applied:
How it works
GlitchText relies on a two-layer CSS pseudo-element technique:
- The rendered element (e.g.
<h1>) receivesdata-text="your string"as a DOM attribute. - The global
.glitch-text-baseclass defines::beforeand::afterpseudo-elements that usecontent: attr(data-text)to duplicate the text. - The
::beforepseudo-element is offset by+2pxhorizontally with a magenta (#ff2bd6) text-shadow, and::afteris offset by-2pxwith a cyan (#22d3ee) text-shadow. - A CSS keyframe animation shifts these offsets over time, creating the characteristic chromatic-aberration flicker.
interactive={false}, the glitch-text-base class is applied unconditionally. When interactive={true}, the component uses a React useState boolean toggled by onMouseEnter / onMouseLeave to add or remove the class dynamically.
CSS classes involved
| Class | Purpose |
|---|---|
.glitch-wrapper | Outer <span> container; receives onMouseEnter / onMouseLeave handlers |
.glitch-text-base | Applied to the inner element; drives the ::before / ::after keyframe animation |