# Text Shimmer (Notchset): prompt.md (v1.0.0)

- id: `text-shimmer` · version 1.0.0 · component · free
- category: Text & motion
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add https://beautiful-ui.dev/r/text-shimmer.json`
- npm dependencies: none
- registry dependencies: utils, https://beautiful-ui.dev/r/notchset-foundation.json
- docs: https://beautiful-ui.dev/components/text-shimmer
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

Working text without a gradient: one letter at a time brightens from muted to ink and back, the light travelling left to right while something runs.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/notchset/text-shimmer.tsx`; shared code: `lib/beautiful-ui/notchset/root.ts`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `notchset-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `TextShimmer`, and every exported type.
- CSS: the install adds the notchset foundation (tokens, keyframes, motion levels) to your global stylesheet once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--notchset-*` custom properties (`--notchset-check`, `--notchset-control-edge`, `--notchset-draw-from`, `--notchset-ease-bloom`, `--notchset-ease-travel`, `--notchset-fade`, `--notchset-focus-color`, `--notchset-focus-inset`, `--notchset-life-from`, `--notchset-life-ms`, `--notchset-node-blink`, `--notchset-node-bloom`, `--notchset-node-delay`, `--notchset-plate-color`, `--notchset-rise-from`, `--notchset-rule`, `--notchset-scroll`, `--notchset-signal`, `--notchset-sweep-to`). Never add Tailwind colour classes inside the component.

```tsx
import { TextShimmer } from "@/components/ui/notchset/text-shimmer";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `TextShimmer` | `text-shimmer` | The text. |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `SoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/notchset-sound.json`, import from `@/components/ui/notchset/sound-provider`); `useSound()` gives `muted` and `setMuted` for a mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/notchset/text-shimmer.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- text shimmer, working text, loading text, thinking text, ai status, shimmer alternative, Notchset
- A line saying what's running right now: summarising, indexing, thinking

### Not when
- Long paragraphs; anything not actually running

## Mistakes
- Put the live region on your status card, not on the shimmer

## Usage

```tsx
import { TextShimmer } from "@/components/ui/notchset/text-shimmer";

export function SummaryStatus({ running }: { running: boolean }) {
  return <TextShimmer active={running}>Summarising migration evals</TextShimmer>;
}
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `children` | `string` |  | The text. |
| `active` | `boolean` |  | Waves while true; still ink when false. |
| `speed` | `number` |  | ms per letter (42). |

Full docs: https://beautiful-ui.dev/components/text-shimmer

## Customising
- Colours: the component reads your shadcn tokens (`--background`, `--foreground`, `--border` …), refined by the `--notchset-*` tokens. The signal colour is `--notchset-signal` (it falls back to `--destructive`). Set tokens on `:root`, or on any container to retheme one area.
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| — | Not interactive |

## Performance

- One CSS animation per letter; nothing in JavaScript.

## Responsive

- Inline: wraps like text.

## Motion inventory

| Interaction | What moves |
|---|---|
| Wave | Each letter brightens to ink at 6% of a 1900ms loop, 42ms after the one before |

## Accessibility contract (preserve when editing)
- Screen readers get the text once, as plain text (no live announcements); only the letter wave is hidden from them
- The wave stops under reduced motion and inside data-motion="off"

## Install

Base UI project (a base-* style in components.json):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/text-shimmer.json
```

Radix project (a radix-*, new-york or default style):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/text-shimmer.json
```

Or add the `@beautiful-ui` registry to components.json and run `npx shadcn@latest add @beautiful-ui/text-shimmer`: the CLI picks the build from your style.

## Credits
- Built on shadcn/ui (https://ui.shadcn.com)

## Source (Base UI build)

### components/ui/notchset/text-shimmer.tsx

```tsx
"use client";

/**
 * Text Shimmer (Notchset) v1.0.0 · Beautiful UI, by Chimpy (https://x.com/stochastichimp)
 * Docs: https://beautiful-ui.dev/components/text-shimmer · Agent prompt: https://beautiful-ui.dev/md/text-shimmer.md
 * MIT licensed: free to use, change and share.
 */

import { cn } from "@/lib/utils";
import { NOTCHSET_ROOT } from "@/lib/beautiful-ui/notchset/root";

/*
 * Notchset Text Shimmer, "working text" (handoff 1.16; no primitive, one file for both builds). Not a
 * gradient: one letter at a time brightens from muted to ink and back, the brightening travelling
 * left to right (1900ms loop, 42ms a letter). Inactive, the text sits still in ink. Under reduced
 * motion the wave stops.
 */

function TextShimmer({ children, active = true, speed = 42, className }: { children: string; active?: boolean; speed?: number; className?: string }) {
  if (!active) return <span data-slot="text-shimmer" className={cn("text-foreground", className)}>{children}</span>;
  // Screen readers read the text once, as ordinary text; only the letter wave is hidden from them. The
  // Notchset root stops the wave under reduced motion and inside data-motion="off".
  return (
    <span {...NOTCHSET_ROOT} data-slot="text-shimmer" className={cn("text-muted-foreground", className)}>
      <span className="sr-only">{children}</span>
      <span aria-hidden>
        {[...children].map((ch, i) => (
          <span key={i} className="motion-safe:animate-[notchset-wave_1900ms_linear_infinite]" style={{ animationDelay: `${i * speed}ms` }}>
            {ch}
          </span>
        ))}
      </span>
    </span>
  );
}

export { TextShimmer };
```

### lib/beautiful-ui/notchset/root.ts

```tsx
/*
 * Notchset's root attributes, server-safe (no client directive), so server components can spread
 * them too. Every Notchset root (and portalled popup) carries data-notchset (the motion policy's
 * scope), plays its own cues in the mechanical voice, and keeps the page's click layer out.
 */
export const NOTCHSET_ROOT = { "data-notchset": "", "data-sound": "none", "data-sound-voice": "analogue" } as const;

/** On every interactive element: it plays its own cues, so the page's click layer adds no tap. */
export const OWN_SOUND = { "data-sound": "none" } as const;
```

The notchset foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/notchset-foundation.json.
