# SelectionMode

> _Since v0.1.1_

Selection mode for the grid.

Each mode offers different selection behavior suited to different use cases:

| Mode | Use Case | Behavior |
|------|----------|----------|
| `'cell'` | Spreadsheet-style editing | Single cell focus. Click to select one cell at a time. |
| `'row'` | Record-based operations | Full row selection. Click anywhere to select the entire row. |
| `'column'` | Spreadsheet-style column operations | Full column selection. Activated via `Ctrl+Click` on header or `Ctrl+Space` on a focused cell. |
| `'range'` | Bulk operations, export | Rectangular selection. Drag or Shift+Click to select ranges. |

`mode` may also be an **array** to enable column selection alongside one in-row mode
(`['row', 'column']`, `['cell', 'column']`, or `['range', 'column']`). When both axes
are enabled, they are mutually exclusive at runtime — selecting a column clears any row
selection, and selecting a row clears any column selection. Only column-paired arrays
are valid; combining other modes (e.g. `['row', 'cell']`) throws at attach time.

```ts
type SelectionMode = "cell" | "row" | "column" | "range"
```

#### Example

```ts
// Cell mode (default) - for spreadsheet-like interaction
new SelectionPlugin({ mode: 'cell' })

// Row mode - for selecting complete records
new SelectionPlugin({ mode: 'row' })

// Column mode - for column-wise operations (copy column, hide column)
new SelectionPlugin({ mode: 'column' })

// Range mode - for bulk copy/paste operations
new SelectionPlugin({ mode: 'range' })

// Both row and column - mutually exclusive at runtime
new SelectionPlugin({ mode: ['row', 'column'] })
```

## See Also

- Cell Mode Demo — Click cells to select
- Row Mode Demo — Full row selection
- Range Mode Demo — Drag to select ranges
