# View

**Category:** Common/Types

## API

### Overview

Defines a saved view in the [`Views`](./?path=/story/features-display-views--views) dropdown. A view captures a snapshot of filters, visible columns, column order, sort directions, and layout type (table or grid). Use `isDefaultView` to set the initial view when the collection loads.

### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `id` | `string` | Yes | - | Unique identifier. Do not use category IDs, `saved-views`, or `predefined-views`. |
| `name` | `string` | Yes | - | What the view is called in the dropdown. |
| `isDefaultView` | `boolean` | No | - | Whether the view is automatically applied when the table initially loads. |
| `extra` | `string` | No | - | Extra data to be passed to the view. |
| `filters` | `Partial<ViewFiltersValues<AllFilters<F>>> \| null` | No | - | Filters to apply when the view is selected. |
| `selectedColumns` | `ColumnViewConfig[]` | No | - | Array of the selected columns for the table layout. |
| `spreadsheetSelectedColumns` | `ColumnViewConfig[]` | No | - | Array of the selected columns for the spreadsheet (EditableTable) layout. |
| `spreadsheetOrderedColumns` | `ColumnViewConfig[]` | No | - | Ordered columns for the spreadsheet (EditableTable) layout. |
| `sortDirections` | `ColumnSortConfig[]` | No | - | Array of sort directions. |
| `layout` | `"grid" \| "table" \| "spreadsheet"` | No | - | Layout type for the view ('table' or 'grid'). |

