---
title: "Text Morse"
description: "The text turns into the dots and dashes of Morse code, then turns back into the words."
url: https://gelatinui.com/components/text-morse
markdown_url: https://gelatinui.com/components/text-morse.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-morse"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Morse

> The text turns into the dots and dashes of Morse code, then turns back into the words.

Page: https://gelatinui.com/components/text-morse

## When to use it

Best for: A short heading that blinks out in Morse code, then decodes to the text.

- Use `loop` to send the code again after a pause.
- Keep it to a short line: each letter has its own code.

## When not to use it

- For text that scrambles before it reads, use [Text Scramble](https://gelatinui.com/components/text-scramble.md).
- For text that types in, use [Text Typewriter](https://gelatinui.com/components/text-typewriter.md).

## Notes for agents

- `children` must be a string.
- It flashes at three times a second at most.

## Anatomy

```text
TextMorse
```

## API reference

### TextMorse

| 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 to code. Letters with no ITU code (CJK, emoji) stay as they are. |
| `trigger` | `ViewEntryTrigger` | "view" | When it starts: `view` (default) the first time it is on screen, `mount` at once. |
| `loop` | `boolean` | true | Code and decode again and again. Default true; false ends on the plain text. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextMorse | `text-morse` |  |  |  |

## Usage

Wrap a short heading.

```tsx title="signal-heading.tsx"
import { TextMorse } from "@/components/pro/text/text-morse";

export function SignalHeading() {
  return (
    <section className="flex flex-col items-center gap-4 py-16 text-center">
      <h2 className="text-4xl font-semibold tracking-tight">
        <TextMorse>Signal received</TextMorse>
      </h2>
      <p className="text-muted-foreground">Real text inside, so people can still select and copy it.</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-morse
```

It adds 29 registry items: 28 files, 4777 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `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 Scramble](https://gelatinui.com/components/text-scramble.md)
- [Text Typewriter](https://gelatinui.com/components/text-typewriter.md)
- [Text ASCII](https://gelatinui.com/components/text-ascii.md)

## Motion

| Part | Motion |
| --- | --- |
| Encode | indicator · 90ms a letter (40ms for a long text) · each letter swaps to its code, then back; about 8s a loop |
