# useTableGridSwitchFolders

**Category:** Base Components/Collections/TableGridSwitchFolders/useTableGridSwitchFolders

## API

### Description

`useTableGridSwitchFolders` is a React hook designed to facilitate the management of the [`TableGridSwitchFolders`](./?path=/story/base-components-collections-tablegridswitchfolders-tablegridswitchfolders--tablegridswitchfolders) component. It returns a [`TableGridSwitchFoldersState`](./?path=/story/base-components-collections-tablegridswitchfolders-tablegridswitchfoldersstate--tablegridswitchfoldersstate) to pass to the `state` prop of `TableGridSwitchFolders`.

```tsx
import { useTableGridSwitchFolders } from '@wix/patterns';
```

### Returns

[TableGridSwitchFoldersState](./?path=/story/base-components-collections-tablegridswitchfolders-tablegridswitchfoldersstate--tablegridswitchfoldersstate)

### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `items` | `CollectionState<T1, F1>` | Yes | - | A [collection state](./?path=/story/common-hooks--usecollection) that fetches items |
| `folders` | `CollectionState<T2, F2>` | Yes | - | A [collection state](./?path=/story/common-hooks--usecollection) that fetches folders |

