# Text reveal

A semantic text entrance with finite word, line, and simple visual staging.

Access: pro. Category: Essentials. Kind: composite.

## When to use

- Use it when a page needs a semantic text entrance with finite word, line, and simple visual staging.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose tidal-button instead when press, loading, success and disabled states is the actual interface need, rather than text reveal.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Text reveal

```sh
npx shadcn@latest add @tidal-pro/text-reveal
```

Stylesheets: `components/ui/tidal.css`, `components/ui/text-reveal.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/text-reveal.css";
import{TidalTextReveal}from"./components/ui/text-reveal";
export default()=><div className="tidal-scope"><TidalTextReveal children={"value"}/></div>;
```

## Structured props

- `TidalTextReveal.children: string`: Plain text is kept intact for the accessible name while only the visual layer is staged.
- `TidalTextReveal.active?: boolean | undefined` (default true): Whether the finite reveal is active. False renders the final readable state.
- `TidalTextReveal.as?: TidalTextRevealTag | undefined` (default "p"): The semantic element that owns the caller's text.
- `TidalTextReveal.durationMs?: number | undefined` (default 420): Bounded entrance duration in milliseconds.
- `TidalTextReveal.mode?: TidalTextRevealMode | undefined` (default "words"): Optional mode value accepted by this exported component.
- `TidalTextReveal.replayKey?: string | number | undefined`: Change this value intentionally to replay the finite reveal.
- `TidalTextReveal.staggerMs?: number | undefined` (default 38): Bounded delay between visual tokens in milliseconds.
- `TidalTextReveal.startDelayMs?: number | undefined` (default 40): Bounded delay before the first visual token.

## Complete usage example

[Source](https://tidalui.com/examples/text-reveal.tsx) | [Manifest](https://tidalui.com/examples/text-reveal.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useState } from "react";

import { RotateCcw } from "lucide-react";

import { TidalTextReveal, type TidalTextRevealMode } from "./components/ui/text-reveal";

import "./components/ui/text-reveal.css";



const tidalExampleStyles = ".tidal-scope .text-reveal-demo {\n  width: 100%;\n  max-width: 1040px;\n  min-width: 0;\n  overflow: hidden;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-card);\n  background: var(--t-subtle);\n  color: var(--t-ink);\n  box-shadow: 0 24px 54px -40px #00000066;\n  container-type: inline-size;\n}\n\n.tidal-scope .text-reveal-demo,\n.tidal-scope .text-reveal-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .text-reveal-demo-layout {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr);\n  min-width: 0;\n}\n\n\n.tidal-scope .text-reveal-demo-stage-head {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n}\n\n.tidal-scope .text-reveal-demo-stage {\n  display: grid;\n  min-width: 0;\n  gap: 21px;\n  padding: 26px;\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px),\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n    var(--t-subtle);\n  background-size: 22px 22px;\n}\n\n.tidal-scope .text-reveal-demo-stage-head {\n  align-items: flex-start;\n  min-width: 0;\n}\n\n.tidal-scope .text-reveal-demo-stage-head > div {\n  min-width: 0;\n}\n\n.tidal-scope .text-reveal-demo-stage-head p {\n  margin: 5px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.5;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .text-reveal-demo-stage-head button,\n.tidal-scope .text-reveal-demo-controls button {\n  min-width: 44px;\n  min-height: 44px;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-control);\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  cursor: pointer;\n  transition:\n    background 160ms,\n    border-color 160ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .text-reveal-demo-stage-head button {\n  display: inline-flex;\n  flex: none;\n  align-items: center;\n  justify-content: center;\n  gap: 7px;\n  padding: 8px 12px;\n  font-size: 11px;\n  font-weight: 650;\n}\n\n.tidal-scope .text-reveal-demo-stage-head button:hover,\n.tidal-scope .text-reveal-demo-controls button:hover {\n  background: var(--t-wash);\n}\n\n.tidal-scope .text-reveal-demo-stage-head button:active,\n.tidal-scope .text-reveal-demo-controls button:active {\n  transform: scale(0.98);\n}\n\n.tidal-scope .text-reveal-demo-stage-head button:focus-visible,\n.tidal-scope .text-reveal-demo-controls button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .text-reveal-demo-sample {\n  min-width: 0;\n  padding: 29px 28px 31px;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-card);\n  background: var(--t-surface);\n  box-shadow: 0 14px 30px -26px #0000005c;\n}\n\n.tidal-scope .text-reveal-demo-sample-label {\n  display: block;\n  margin-bottom: 19px;\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 650;\n  letter-spacing: 0.12em;\n}\n\n.tidal-scope .text-reveal-demo-sample h2 {\n  max-width: 660px;\n  font-size: clamp(29px, 5.3cqi, 56px);\n  font-weight: 500;\n  letter-spacing: -0.06em;\n  line-height: 0.99;\n  text-wrap: balance;\n}\n\n.tidal-scope .text-reveal-demo-sample > p {\n  max-width: 470px;\n  margin: 19px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.65;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .text-reveal-demo-controls {\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  gap: 8px;\n  min-width: 0;\n}\n\n.tidal-scope .text-reveal-demo-controls button {\n  display: grid;\n  min-width: 0;\n  align-content: center;\n  justify-items: start;\n  gap: 3px;\n  padding: 9px 12px;\n  text-align: start;\n}\n\n.tidal-scope .text-reveal-demo-controls button[aria-pressed=\"true\"] {\n  border-color: var(--t-ink);\n  background: var(--t-ink);\n  color: var(--t-surface);\n}\n\n.tidal-scope .text-reveal-demo-controls span,\n.tidal-scope .text-reveal-demo-controls small {\n  min-width: 0;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .text-reveal-demo-controls span {\n  font-size: 11px;\n  font-weight: 650;\n}\n\n.tidal-scope .text-reveal-demo-controls small {\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.35;\n}\n\n.tidal-scope .text-reveal-demo-controls button[aria-pressed=\"true\"] small {\n  color: color-mix(in srgb, var(--t-surface) 78%, var(--t-ink));\n}\n\n.tidal-scope .text-reveal-demo-status {\n  margin: -5px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.45;\n  overflow-wrap: anywhere;\n}\n\n@container (max-width: 760px) {\n  .tidal-scope .text-reveal-demo-layout {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n\n@container (max-width: 500px) {\n  .tidal-scope .text-reveal-demo-stage {\n    gap: 17px;\n    padding: 14px;\n    background-size: 18px 18px;\n  }\n\n  .tidal-scope .text-reveal-demo-stage-head {\n    display: block;\n  }\n\n  .tidal-scope .text-reveal-demo-stage-head button {\n    width: 100%;\n    margin-top: 13px;\n  }\n\n  .tidal-scope .text-reveal-demo-sample {\n    padding: 23px 19px 25px;\n  }\n\n  .tidal-scope .text-reveal-demo-sample h2 {\n    font-size: 31px;\n  }\n\n  .tidal-scope .text-reveal-demo-controls {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .text-reveal-demo-stage-head button,\n  .tidal-scope .text-reveal-demo-controls button {\n    transition: none;\n    transform: none;\n  }\n}";

const MODES: readonly TidalTextRevealMode[] = ["words", "lines", "simple"];

const MODE_COPY: Record<TidalTextRevealMode, { label: string; note: string }> =
  {
    words: { label: "Words", note: "Each word takes its place." },
    lines: { label: "Lines", note: "Line breaks become the rhythm." },
    simple: { label: "Simple", note: "One quiet surface reveal." },
  };

const REVEAL_COPY: Record<TidalTextRevealMode, string> = {
  words: "Make the next decision easier to see.",
  lines: "Make the next decision\neasier to see.",
  simple: "Make the next decision easier to see.",
};

export function TextRevealDemo() {
  const [mode, setMode] = useState<TidalTextRevealMode>("words");
  const [replayKey, setReplayKey] = useState(0);
  const [replayCount, setReplayCount] = useState(0);

  function chooseMode(nextMode: TidalTextRevealMode) {
    setMode(nextMode);
    setReplayKey((value) => value + 1);
  }

  function replay() {
    setReplayKey((value) => value + 1);
    setReplayCount((value) => value + 1);
  }

  return (
    <section className="text-reveal-demo" aria-label="Text reveal preview">
      <div className="text-reveal-demo-layout">
        <div className="text-reveal-demo-stage">
          <div className="text-reveal-demo-stage-head">
            <div>
              <p>Choose a staging mode, then replay the entrance.</p>
            </div>
            <button type="button" onClick={replay}>
              <RotateCcw size={14} aria-hidden="true" />
              Replay
            </button>
          </div>

          <div className="text-reveal-demo-sample">
            <span className="text-reveal-demo-sample-label">
              CURRENT MODE / {mode}
            </span>
            <TidalTextReveal
              as="h2"
              mode={mode}
              replayKey={replayKey}
              durationMs={420}
              staggerMs={mode === "words" ? 34 : 54}
            >
              {REVEAL_COPY[mode]}
            </TidalTextReveal>
            <p>
              A semantic heading with a visual entrance that can stop at its
              final readable state.
            </p>
          </div>

          <div
            className="text-reveal-demo-controls"
            role="group"
            aria-label="Reveal mode"
          >
            {MODES.map((option) => (
              <button
                key={option}
                type="button"
                aria-pressed={mode === option}
                onClick={() => chooseMode(option)}
              >
                <span>{MODE_COPY[option].label}</span>
                <small>{MODE_COPY[option].note}</small>
              </button>
            ))}
          </div>

          <p className="text-reveal-demo-status" aria-live="polite">
            {MODE_COPY[mode].label} staging selected. Replay is local and
            finite.
            {replayCount > 0 ? ` Replay ${replayCount} requested.` : ""}
          </p>
        </div>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <TextRevealDemo />
    </div>
  );
}

```

## Gotchas

- Install the declared registry dependencies and render inside a tidal-scope with the foundation stylesheet loaded.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

TidalTextReveal owns a caller-selected semantic tag (as) and plain string children. mode selects words, lines, or one simple visual reveal; active=false renders the final state; replayKey intentionally remounts only the aria-hidden visual layer for a finite replay. durationMs, staggerMs, and startDelayMs are bounded before they reach CSS. The root keeps a visually hidden copy of the original text when caller labelling is absent, while aria-label or aria-labelledby remains authoritative when supplied. Native HTMLElement attributes and refs are forwarded. Motion is finite, reduced motion renders the readable final state, and the component performs no observation, request, storage, timer, or perpetual animation.
