# Rich Text Editor

Short structured writing that exports clean Markdown and HTML.

Tier: Free

## Installation

```bash
npx shadcn add @fetaui/rich-text-editor
```

## Usage

```tsx
import { RichTextEditor } from '@fetaui/components/rich-text-editor'

export function Example() {
  return <RichTextEditor onChange={save}><h1>Release notes</h1></RichTextEditor>
}
```

## API

| Prop | Type | Default |
|---|---|---|
| children | h1, h2, p, ul, blockquote, pre |  |
| label | string | Editor |
| placeholder | string |  |
| source | boolean | true |
| onChange | ({ markdown, html }) => void |  |
| animated | boolean | true |

## When to use

- For release notes, descriptions and comments.
- Keep the source panel when people paste the result elsewhere.

## When not to use

- For long documents.

## Accessibility

- A textbox with aria-multiline, and the format bar is a toolbar with pressed states.
- Pasted content comes in as plain text. Exports keep only known tags and safe links.

## Motion

- The format bar rises 4 px and scales from 0.96 in 140 ms, with bold, italic, code, heading, quote, list and link.
- The block menu drops 4 px in 160 ms.
- Copy says Copied for 2 s and the word count rolls.
- With reduced motion, the bar and menu fade.
