---
title: "Text Stroke Draw"
description: "The outline of a heading draws itself in the real font, then the letters fill with color."
url: https://gelatinui.com/components/text-stroke-draw
markdown_url: https://gelatinui.com/components/text-stroke-draw.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-stroke-draw"
version: "2026-11-14"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Stroke Draw

> The outline of a heading draws itself in the real font, then the letters fill with color.

Page: https://gelatinui.com/components/text-stroke-draw

## When to use it

Best for: A short heading or a wordmark at a large size that draws once, on mount or in view.

- Use it on a large heading or a wordmark: the outline reads best at 36px and larger.
- Use `delay` to draw a second line after the first.
- Use `fill={false}` to keep the outline as a line drawing.
- Use `strokeWidth` for a thinner or bolder outline; the color comes from the text color.

## When not to use it

- For text that types in letter by letter with a caret, use [Text Typewriter](https://gelatinui.com/components/text-typewriter.md).

## Notes for agents

- `children` must be a string. A new text, or a new `fill`, `delay`, `trigger`, or `locale`, draws again from the hidden look.
- The text wraps between words, as plain text does, and every line draws at the same time. A word longer than the line does not break, also with `overflow-wrap`: on a phone, size the heading so its longest word fits.
- The real text is an HTML copy at opacity 0 under an SVG outline, so it selects, copies, and reads as the plain text. Do not add an aria-label.
- The text stays hidden until the draw starts: in the server HTML, and with no JavaScript.
- `trigger` defaults to `view`: it draws once, the first time a part of the text is on screen in a visible tab. Use `mount` above the fold.
- A color emoji has no outline: it shows whole when the draw starts, also with `fill={false}`.
- The outline follows the font of the page, and it measures again when a font loads or the size changes.

## Anatomy

```text
TextStrokeDraw
```

## API reference

### TextStrokeDraw

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `locale` | `string` |  | The BCP 47 locale for the letter and word split (`Intl.Segmenter`). Default: the `DisplayLocaleProvider` locale, else `"en-US"`. |
| `children` | `string` |  | The text: a heading, a word, a logo. It wraps between words, as plain text does. |
| `trigger` | `"mount" \| "view"` | "view" | When the outline draws: `view` (default) the first time it is on screen, `mount` at once. |
| `delay` | `number` | 0 | Seconds to wait before it draws. Default 0. |
| `fill` | `boolean` | true | Fill the letters after the outline is drawn. Default true; `false` keeps the outline only. |
| `strokeWidth` | `number` | 1.5 | The outline width in px. Default 1.5. |
| `onComplete` | `function` |  | Called when the outline (and the fill) are done. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextStrokeDraw | `text-stroke-draw` |  |  |  |

## Usage

Wrap the text of a heading. Draw the next line with `delay`.

The sample also uses `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui-pro/text-stroke-draw @gelatin-ui/button
```

```tsx title="studio-hero.tsx"
import { TextStrokeDraw } from "@/components/pro/text/text-stroke-draw";
import { Button } from "@/components/ui/button";

export function StudioHero() {
  return (
    <section className="flex max-w-2xl flex-col items-start gap-4 py-16">
      <h1 className="text-6xl font-bold tracking-tight">
        <TextStrokeDraw trigger="mount">Northwind</TextStrokeDraw>
      </h1>
      <p className="text-3xl font-semibold text-muted-foreground">
        <TextStrokeDraw trigger="mount" delay={0.6} fill={false}>
          Brand and product design
        </TextStrokeDraw>
      </p>
      <Button>See our work</Button>
    </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-stroke-draw
```

It adds 17 registry items: 16 files, 3257 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`.

## 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 Typewriter](https://gelatinui.com/components/text-typewriter.md)
- [Highlight](https://gelatinui.com/components/highlight.md)

## Motion

| Part | Motion |
| --- | --- |
| Draw | draw · 900ms · the outline of every letter draws at the same time, from its start to its end |
| Fill | reveal · 400ms · after the draw, the fill fades in as the outline fades out; `fill={false}` keeps the outline |
| Start | instant · the text shows after `delay` seconds, at mount or the first time it is in view |
