Glitch text preview

Interactive preview of the CyberSpec Glitch text component. Text that decodes itself into place and tears for a moment, with a stable copy for screen readers.

About this preview

Glitch text belongs to the HUD group in the CyberSpec catalog. It uses markup and CSS.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/glitch-text.json

Example

"use client"

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

export default function GlitchTextDemo() {
  return (
    <div style={{ display: "grid", gap: 6, justifyItems: "start", width: "100%" }}>
      <GlitchText as="strong" decode="view" style={{ fontSize: 34, fontWeight: 700, letterSpacing: "0.04em", lineHeight: 1 }}>
        SIGNAL ACQUIRED
      </GlitchText>
      <GlitchText decode="hover" style={{ color: "var(--cy-signal)" }}>
        Hover to re-key the handshake
      </GlitchText>
    </div>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/glitch-text-demo.json

Resources

View as Markdown