GooseUI

Components

Glitch Text


Animated glitch text effect with chromatic aberration, scanlines, and distortion. A server component: CSS keyframes on clip-path and mix-blend-mode, no client JavaScript. Respects reduced motion preferences.

Browser Support

clip-path

Clips the glitch layers.

Your browser:
mix-blend-mode

Blends the glitch colors.

Your browser:

Preview

Hover to see the effect in action.

GLITCH

Installation

npx shadcn@latest add @gooseui/glitch-text
pnpm dlx shadcn@latest add @gooseui/glitch-text
yarn dlx shadcn@latest add @gooseui/glitch-text
bunx --bun shadcn@latest add @gooseui/glitch-text

Usage

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

export default function Page() {
  return (
    <div className="p-8">
      <GlitchText
        text="GLITCH"
        className="text-6xl text-foreground"
      />
    </div>
  )
}

Examples

Intensity Variants

Control the intensity of the glitch effect: low, medium, or high.

Low
SUBTLE
Medium
DEFAULT
High
INTENSE
<GlitchText text="SUBTLE" intensity="low" />
<GlitchText text="DEFAULT" intensity="medium" />
<GlitchText text="INTENSE" intensity="high" />

Custom Colors

Use the color prop for custom text colors.

NEON
CYBER
PUNK
<GlitchText text="NEON" color="#00b36b" />
<GlitchText text="CYBER" color="#e6006e" />
<GlitchText text="PUNK" color="#d99a00" />

Minimal Effect

Disable scanlines and glow for a cleaner look.

CLEAN
<GlitchText
  text="CLEAN"
  showScanlines={false}
  showGlow={false}
/>

Hero Section

Example usage in a hero section.

GOOSEUI

Component Library

<div className="py-16">
  <GlitchText
    text="GOOSEUI"
    intensity="medium"
    className="text-8xl text-foreground font-black"
  />
  <p className="text-muted-foreground tracking-[0.3em] uppercase">
    Component Library
  </p>
</div>

Props

PropTypeDefaultDescription
textstring-Text to display with glitch effect
intensity"low" | "medium" | "high""medium"Intensity of the glitch effect
showScanlinesbooleantrueShow scanline overlay effect
showGlowbooleantrueShow glow effect behind text
colorstring-Custom text color (CSS color value)
classNamestring-Additional CSS classes for styling

Features

  • Chromatic aberration — cyan and magenta color separation with mix-blend-mode
  • Clip-path animation — random slice effect using CSS clip-path inset
  • Scanlines overlay — retro CRT monitor effect
  • Glow effect — blur-based glow behind text
  • Reduced motion — respects prefers-reduced-motion media query
  • Pure CSS — no JavaScript animations, uses CSS keyframes
  • Customizable — intensity, colors, and effects can be toggled