# DataGridClipboardApi (@salmonui/data-grid)

> The DataGridClipboardApi interface of @salmonui/data-grid: Clipboard methods of the DataGrid instance. Need editing (it registers the clipboard module).

Canonical: https://salmonui.dev/docs/reference/data-grid/DataGridClipboardApi

```ts
import type { DataGridClipboardApi } from '@salmonui/data-grid';
```

Entry index: https://salmonui.dev/docs/reference/data-grid (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid.md).

## Reference

Kind: interface

```ts
interface DataGridClipboardApi {
    copy(options?: DataGridCopyOptions): CommandResult;
    paste(text?: string): CommandResult;
}
```

Clipboard methods of the `DataGrid` instance. Need `editing` (it registers the clipboard module).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `copy` | `copy(options?: DataGridCopyOptions): CommandResult;` |  | Copies the cell range, else the selected rows, else the focused cell to the system clipboard (drafts included). Falls back to a copy dialog when the browser blocks clipboard access. `rejected` with `nothingToCopy` or `cancelled` (`onBeforeCopy`). |
| `paste` | `paste(text?: string): CommandResult;` |  | Pastes TSV `text` at the selected range or focused cell. Without `text`, reads the system clipboard (`async`), or opens a paste dialog when the Clipboard API is unavailable. |
