2025-08-20 04:12:49 -06:00

83 lines
1.7 KiB
Plaintext

---
title: Writing Text
description: A text component that smoothly reveals content word by word.
author:
name: imskyleen
url: https://github.com/imskyleen
---
<ComponentPreview name="writing-text-demo" />
## Installation
<ComponentInstallation name="writing-text" />
## Usage
```tsx
<WritingText text="Hello world!" />
```
## Props
<TypeTable
type={{
className: {
description: 'The className of the component',
type: 'string',
required: false,
},
duration: {
description: 'The duration of the animation',
type: 'number',
default: '2',
required: false,
},
delay: {
description: 'The delay of the animation',
type: 'number',
default: '0.5',
required: false,
},
inView: {
description: 'Enable animation when in view.',
type: 'boolean',
default: 'false',
required: false,
},
inViewMargin: {
description: 'The margin of the in view.',
type: 'string',
required: false,
default: '0px',
},
inViewOnce: {
description: 'Enable animation when in view once.',
type: 'boolean',
required: false,
default: 'true',
},
spacing: {
description: 'The spacing between the words',
type: 'number | string',
default: '5',
required: false,
},
text: {
description: 'The text to display',
type: 'string',
required: true,
},
transition: {
description: 'The transition of the writing text',
type: 'Transition',
required: false,
default: "{ type: 'spring', bounce: 0, duration: 2, delay: 0.5 }",
},
}}
/>
## Credits
- Credits to [Motion](https://examples.motion.dev/react/split-text) for the inspiration