Skip to Content
Kokonut UI

TX-03Texts

Glitch Text

Flat text that cuts into hard-shifted bands with a thin red/cyan split, on idle, hover or text change.

Install with
no extra packages

PROKinetic Type Hero and more like it are in Kokonut UI Pro

Installation

Glitch Text is a free, open-source React component in the Kokonut UI Texts collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/glitch-text.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/glitch-text

Usage

import GlitchText from "@/components/kokonutui/glitch-text";

export default function Example() {
  return <GlitchText />;
}

Props

text
stringDefault "Signal Text"

Text to render. Changing it glitches over to the new text.

trigger
GlitchTextTriggerDefault "idle"

What starts a burst. Defaults to idle.

intensity
GlitchTextIntensityDefault "medium"

Band count, displacement and channel split. Defaults to medium.

accent
stringDefault built-in

Color of the leading channel during a burst. The other one is cyan.

className
string

Extra classes for the root element.

as
"span" | "div" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6"Default "span"

Root element. A span by default, so it also fits inside a heading.

GlitchTextTrigger

- idle: a burst every 4-9s while on screen, plus on text changes. - hover: a burst on pointer enter (or tap), plus on text changes. - change: only text changes glitch; the burst is the transition.

type GlitchTextTrigger = "idle" | "hover" | "change";

GlitchTextIntensity

type GlitchTextIntensity = "subtle" | "medium" | "strong";

Dependencies

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.