---
title: "Text Strike Morph"
description: "When the text changes, a line strikes out the old words, they drop away, and the new ones slide in."
url: https://gelatinui.com/components/text-strike-morph
markdown_url: https://gelatinui.com/components/text-strike-morph.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-strike-morph"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Strike Morph

> When the text changes, a line strikes out the old words, they drop away, and the new ones slide in.

Page: https://gelatinui.com/components/text-strike-morph

## When to use it

Best for: A short text that changes in place, where the letters that stay should slide, not blink.

- Pass the text as `children`; a new value morphs from the old one.
- Set `reserveWidthFor` with every value in a fixed slot, such as a price, so its width never changes.
- Leave `reserveWidthFor` out in a sentence, so the words after it slide with the width.

## When not to use it

- For the same effect with another look, use [Text Blur Morph](https://gelatinui.com/components/text-blur-morph.md).
- For a number that counts up or down digit by digit, use [Rolling Number](https://gelatinui.com/components/rolling-number.md).
- For a number that counts from one value to another, use [Count Up](https://gelatinui.com/components/count-up.md).

## Notes for agents

- Strike Morph owns its look: it builds on Text Morph and takes every other Text Morph prop and part.
- Never put it in a button: a button label stays plain text.
- `children` must be a string.
- Short text morphs by grapheme, long text by word; set `granularity` to choose.
- Arabic always morphs by word, because its letters join.
- Set `dir` on it or a parent for right-to-left text.

## Anatomy

```text
TextStrikeMorph
```

## API reference

### TextStrikeMorph

| 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 show. A new value morphs from the old one. |
| `granularity` | `TextGranularity` |  | The size of the moving pieces. Default: `grapheme` for short text, else `word`. A script that joins its letters (Arabic) always morphs by word (`resolveGranularity` in `#/lib/split-text`). |
| `reserveWidthFor` | `readonly string[]` |  | Every text this morph can show (`["Copy link", "Copied"]`). The root keeps the width of the widest one, so a price or a badge never changes size between states; only the letters move inside it. Align the text in that width with `justify-items-*` on the root (start by default). Leave it out for text in a sentence: there the width slides instead. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextStrikeMorph | `text-strike-morph` |  |  |  |

## Usage

Pass the text as children, and every value in `reserveWidthFor` so the price keeps its width.

```tsx title="plan-price.tsx"
import { TextStrikeMorph } from "@/components/pro/text/text-strike-morph";

type Billing = "monthly" | "yearly";

const PRICES: Record<Billing, string> = { monthly: "$24", yearly: "$240" };
const PERIODS: Record<Billing, string> = { monthly: "per month", yearly: "per year" };

export function PlanPrice({ billing }: { billing: Billing }) {
  return (
    <div className="flex flex-col gap-1">
      <span className="text-sm text-muted-foreground">Team plan</span>
      <p className="flex items-baseline gap-2">
        <TextStrikeMorph
          reserveWidthFor={Object.values(PRICES)}
          className="text-4xl font-semibold tabular-nums"
        >
          {PRICES[billing]}
        </TextStrikeMorph>
        <TextStrikeMorph className="text-sm text-muted-foreground">{PERIODS[billing]}</TextStrikeMorph>
      </p>
    </div>
  );
}
```

## 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-strike-morph
```

It adds 19 registry items: 18 files, 3200 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 Blur Morph](https://gelatinui.com/components/text-blur-morph.md)
- [Rolling Number](https://gelatinui.com/components/rolling-number.md)
- [Count Up](https://gelatinui.com/components/count-up.md)
- [Number Text](https://gelatinui.com/components/number-text.md)

## Motion

| Part | Motion |
| --- | --- |
| Slide | panel · shared pieces slide to their new place, and the width follows |
| Enter | indicator · new pieces rise 0.25em and fade in from a blur, 30ms apart |
| Exit | popup · old pieces rise and fade out with a blur |
| Strike exit | indicator · with `effect="strike"`, a line draws through each old piece, then it drops 0.25em and fades on popup; new pieces slide in from the inline start after the line |
