# TableGridSwitchState

**Category:** Base Components/Collections/TableGridSwitch/TableGridSwitchState

## API

### Overview

`TableGridSwitchState` manages the state for a [`TableGridSwitch`](./?path=/story/base-components-collections-tablegridswitch--tablegridswitch) component, which lets users switch between table and grid views. Wraps a `GridState` and a `TableState` with a shared `viewTypeState`. Created by [`useTableGridSwitchCollection`](./?path=/story/common-hooks--usetablegridswitchcollection).

### Description

`TableGridSwitchState` is the return value of the [`useTableGridSwitchCollection()`](./?path=/story/base-components-collections-tablegridswitch-usetablegridswitchcollection--usetablegridswitchcollection) hook.

### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `tableState` | `TableState<T, F>` | Yes | - | [TableState](./?path=/story/common-state--tablestate) |
| `gridState` | `GridState<T, F>` | Yes | - | [GridState](./?path=/story/common-state--gridstate) |
| `collection` | `CollectionState<T, F>` | Yes | - | Underlying [CollectionState](./?path=/story/common-state--collectionstate) |
| `toolbar` | `ToolbarCollectionState<T, F>` | Yes | - | Underlying [ToolbarCollectionState](./?path=/story/common-state--toolbarcollectionstate) |

