Glitch Text

Color channels split and the text tears into slices, then snaps back.

no dependenciesMIT · free
SYSTEM ERROR

Or only on hover: hover me

Installation

npx shadcn@latest add https://ombakui.com/r/glitch-text.json

Usage

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

<GlitchText text="SYSTEM ERROR" className="font-mono text-6xl font-bold" />
<GlitchText text="hover me" trigger="hover" />

Props

PropTypeDefaultDescription
text*string–The text.
asElementType"span"HTML tag to render.
trigger"loop" | "hover""loop""loop" glitches every few seconds; "hover" glitches while hovered.
colors[string, string]["#ff2bd6", "#22d3ee"]Colors of the two split channels.
classNamestring–