# Text Fade Replace

Cross-fades between two strings on the same line. Includes a Strikethrough variant.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

## Installation

<TabsTrigger value="cli">Command</TabsTrigger>
<TabsTrigger value="manual">Manual</TabsTrigger>

```bash
npx shadcn@latest add @framecn/text-fade-replace
```

<Step>Copy and paste the following code into your project.</Step>

<Step>Update the import paths to match your project setup.</Step>

## Usage

```tsx
import { TextFadeReplace } from "@/components/framecn/text-fade-replace";
```

```tsx
<TextFadeReplace from="value" to="value" />
```

## API Reference

### TextFadeReplace

| Prop               | Type     | Default              |
| ------------------ | -------- | -------------------- |
| `from`             | `string` | `-`                  |
| `to`               | `string` | `-`                  |
| `fontSize`         | `number` | `48`                 |
| `color`            | `string` | `"#171717"`          |
| `fontWeight`       | `number` | `600`                |
| `speed`            | `number` | `1`                  |
| `fps`              | `number` | `FPS`                |
| `durationInFrames` | `number` | `DURATION_IN_FRAMES` |
| `className`        | `string` | `-`                  |

## Notes

  The component supports a strikethrough animation variant. Check the demo to
  see the strikethrough effect in action.

  For the best cross-fade effect, ensure `fromText` and `toText` are
  approximately the same length to avoid layout shift.