---
title: "Text Outline Spotlight"
description: "Only the outlines of the letters show, until a round light under the pointer fills them with color."
url: https://gelatinui.com/components/text-outline-spotlight
markdown_url: https://gelatinui.com/components/text-outline-spotlight.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-outline-spotlight"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Outline Spotlight

> Only the outlines of the letters show, until a round light under the pointer fills them with color.

Page: https://gelatinui.com/components/text-outline-spotlight

## When to use it

Best for: A short heading or label that a soft light follows, to show it in color or to show a hidden text under it.

- Pass `reveal` to show another text in the light: a hidden message, an answer, or a translation.
- Put it inside a link or a button when the text leads somewhere: keyboard focus on it sweeps the light.

## When not to use it

- For the same effect with another look, use [Text Plain Spotlight](https://gelatinui.com/components/text-plain-spotlight.md).
- For text a reader must open on purpose, such as a spoiler with a clear control, use [Spoiler](https://gelatinui.com/components/spoiler.md).
- For a plain mark on a key phrase, use [Highlight](https://gelatinui.com/components/highlight.md).

## Notes for agents

- Outline Spotlight Text is Spotlight Text with `variant="outline"` fixed: it takes every other Spotlight Text prop and part.
- `children` is the text. It stays real text: people can select it and a screen reader reads it once.
- `reveal` is what the light shows in place of the text. It is `aria-hidden` and cannot be selected, so a screen reader and a copy get only `children`.
- With `reveal` and no link or button around it, the text is its own toggle button (`aria-pressed`): Tab sweeps the light, and Enter, Space, or a click holds it over all of the text.
- Inside a link or a button (or with `tabIndex`), keyboard focus sweeps the light across the text from the start edge, then opens it over all of the text. Right to left starts at the right edge.
- A finger moves the light too, and the page still scrolls up and down (`touch-action: pan-y`). The light fades when the finger lifts or the scroll starts.
- `radius` is the size of the light in px (default 120). The light is solid to 60% of it, then soft.
- A light held over all of the text centers and grows again when the text wraps or resizes.
- The light moves to the pointer in the same frame, with no lag, and writes three custom properties on the root: no React render on a pointer move.

## Anatomy

```text
TextOutlineSpotlight
```

## API reference

### TextOutlineSpotlight

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | The text. It stays real text: selectable. |
| `reveal` | `ReactNode` |  | What the light shows instead of the text in color: a hidden message, a translation, a spoiler. Default: the text in the gradient text colors. |
| `radius` | `number` |  | The radius of the light in px. Default 120. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextOutlineSpotlight | `text-outline-spotlight` |  |  |  |

## Usage

Wrap the words of a heading or a link. Pass `reveal` to show a hidden text inside the light.

```tsx title="launch-hero.tsx"
import { TextOutlineSpotlight } from "@/components/pro/text/text-outline-spotlight";

export function LaunchHero() {
  return (
    <section className="flex flex-col items-center gap-4 py-16 text-center">
      <p className="text-sm font-medium text-muted-foreground">Launch week, day 3</p>
      <h1 className="text-7xl font-black tracking-tighter">
        <TextOutlineSpotlight radius={160}>
          Shipped in the dark
        </TextOutlineSpotlight>
      </h1>
      <p className="max-w-md text-muted-foreground">
        Night mode for every screen, with the contrast checked on each one.
      </p>
      <p className="text-3xl font-semibold">
        <TextOutlineSpotlight reveal={<span className="text-primary">Out on Friday</span>}>
          Find the date
        </TextOutlineSpotlight>
      </p>
    </section>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/text-outline-spotlight
```

It adds 19 registry items: 18 files, 3046 lines, and the npm packages `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Text Plain Spotlight](https://gelatinui.com/components/text-plain-spotlight.md)
- [Highlight](https://gelatinui.com/components/highlight.md)
- [Spoiler](https://gelatinui.com/components/spoiler.md)
- [Magnetic](https://gelatinui.com/components/magnetic.md)
- [Tilt](https://gelatinui.com/components/tilt.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves the focus to the text, or to the link or button around it. The light sweeps across the text, then covers all of it. |
| Enter, Space | With `reveal` and no control around it: holds the light over all of the text, or lets it go. |

## Motion

| Part | Motion |
| --- | --- |
| Grow | panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) · the light grows to its radius where the pointer enters |
| Fade | fade · 150ms · ease-out (0, 0, 0.2, 1) · the light shrinks to nothing when the pointer leaves |
| Focus sweep | draw · 900ms · ease-panel (0.2, 0.4, 0.2, 1) · the light crosses the text once from the start edge on keyboard focus |
| Cover | panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) · the light glides to the middle and grows over all of the text after the sweep or on a press |
