# Typeset — Animated Text Effect for React

> Canvas ASCII renderer with amber-phosphor persistence: a headline (or a flowing noise field) redrawn as a weight-ramped glyph grid that pours in, shimmers, and brightens under the cursor; idles on its own when untouched.

- Page: https://crucibleui.com/components/text/typeset
- Category: [text](https://crucibleui.com/components/text)
- Tier: pro (one-time purchase, see https://crucibleui.com/pricing)
- Engine: canvas

## Install

```bash
npx shadcn@latest add @crucible/typeset
```

Pro install requires adding the token-bearing `@crucible` registry to components.json (issued at https://crucibleui.com/account after purchase).

Import from `@/components/crucible/typeset`.

## Props (`TypesetProps`)

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text?` | `string` | `"TYPESET"` | Headline rendered as the ASCII field (also emitted as sr-only text). |
| `mode?` | `"text" \| "fluid"` | `"text"` | `"text"` rasterizes the headline into the glyph grid; `"fluid"` renders a flowing turbulent-noise field as an ASCII brightness ramp. |
| `charset?` | `string` | `" .:-=+*#%@"` | Character ramp ordered light → heavy; local density picks the glyph. The first character should be a space (empty cells). |
| `cellSize?` | `number` | `12` | Grid cell size in px. Bigger = chunkier terminal art. |
| `color?` | `string` | `amber phosphor `#ffb000`` | Single signature hue as a hex color (#rgb / #rrggbb). Bright cells bloom toward white. |
| `speed?` | `number` | `1` | Animation-rate multiplier (shimmer, fluid churn, pour-in). |
| `paused?` | `boolean` | `false` | Freeze the field at a fully formed static frame. |
| `seed?` | `number` | `3` | Deterministic seed for shimmer phases and the noise field. |
| `idle?` | `boolean` | `true` | Idle autoplay: after 1.5s with no pointer over the field, a ghost point drifts through it on a slow Lissajous path (at slightly reduced strength), brightening and agitating cells; a real pointer takes over instantly. Never under reduced motion; sleeps offscreen and when paused. |
| `ref?` | `React.Ref<TypesetHandle>` | — | React 19 ref prop — imperative `replay()` of the pour intro. |

Also accepts: `Omit<React.ComponentPropsWithoutRef<"div">, "children" | "color">`.

## Usage example

```tsx
import { Typeset } from "@/components/crucible/typeset";

export default function TypesetDemo() {
  return (
    <div className="relative isolate flex h-full min-h-[360px] w-full items-center justify-center overflow-hidden rounded-xl bg-neutral-950">
      <div className="relative z-10 flex w-full max-w-2xl flex-col items-center gap-5 px-6 py-8">
        <Typeset text="HELLO" className="h-44 min-h-0 w-full" />
        <p className="text-sm text-neutral-500">Move your cursor through the letters</p>
        <div className="flex w-full flex-col items-center gap-2">
          <Typeset
            mode="fluid"
            text="Flowing ASCII field"
            color="#7dd3fc"
            cellSize={10}
            className="h-24 min-h-0 w-full max-w-md"
          />
          <span className="text-[10px] font-medium uppercase tracking-[0.2em] text-neutral-600">
            Custom colors
          </span>
        </div>
      </div>
    </div>
  );
}
```

## Accessibility & performance

Honors `prefers-reduced-motion` with a designed static frame or fade (never a blank box) and passes `className` through. Pauses offscreen and on hidden tabs, clamps device pixel ratio, and tears down its GL/canvas context on unmount.
