import { Meta } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/functional-basic/Functions/writeClipboardData - Writing text to the clipboard'/>

# `writeClipboardData`

Writes a text string to the user's clipboard. It uses the modern `navigator.clipboard API`, falling back to `document.execCommand` if the former is unavailable.

**Parameters:**
- `text: string` — The text to write.

**Returns:**
`Promise<void>` — A promise that resolves after a successful write.

```typescript
import { writeClipboardData } from '@dxtmisha/functional-basic'

await writeClipboardData('Copied text')
```
