# 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.

[View Glitch text preview on CyberSpec](https://www.cyberspec.dev/preview/glitch-text)

## 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.

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

## Example

```tsx
"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

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

## Resources

- [Glitch text documentation](https://www.cyberspec.dev/components/sidebar/glitch-text.md)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Glitch text source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/glitch-text.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/glitch-text.json)
