---
title: "Cascader"
description: "Pick a value from a tree of levels, such as region, country, and city. Go one level at a time or see columns, pick one or many, and search all levels."
url: https://gelatinui.com/components/cascader
markdown_url: https://gelatinui.com/components/cascader.md
access: free
install: "npx shadcn@latest add @gelatin-ui/cascader"
registry_item: https://gelatinui.com/r/cascader.json
version: "2026-11-11"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Cascader

> Pick a value from a tree of levels, such as region, country, and city. Go one level at a time or see columns, pick one or many, and search all levels.

Page: https://gelatinui.com/components/cascader

## When to use it

Best for: Pick a value from a tree of levels, one level at a time or in columns, with search.

- Use it when the values form levels, such as Region, Country, and City.
- Use `mode` to show one level at a time (`drill`) or levels side by side (`columns`).
- Use `multiple` to pick many values, and `max` to limit them.
- Use `getChildren` to load a level when it opens.

## When not to use it

- For a flat list with search, use a [Combobox](https://gelatinui.com/components/combobox.md).
- For a short flat list, use a [Select](https://gelatinui.com/components/select.md).
- For a tree that stays open on the page, use a Tree.

## Notes for agents

- `value` and `onValueChange` always use a `string[]`, also with one value.
- Each node of `items` has `value`, `label`, and optional `children`.
- Compose `Cascader` with `CascaderTrigger` and `CascaderContent`. With `inline` it shows the panel with no popup.
- Under 640px the surface is a bottom Drawer, and `columns` turns to `drill`.
- Focus stays in the search box, and the active row moves. Do not move focus to the rows.
- A level of 100 rows or more draws only the rows on screen.
- `clearable` and `display` go on `CascaderTrigger`, not on the root.
- With one value and `selectable="any"`, a press on a branch row picks it, and its chevron opens it.

## Anatomy

```text
Cascader
├─ CascaderTrigger (0..n)
├─ CascaderValue (0..n)
├─ CascaderContent (0..n)
├─ CascaderPanel (0..n)
├─ CascaderSearch (0..n)
├─ CascaderViewSwitch (0..n)
├─ CascaderHeader (0..n)
├─ CascaderLists (0..n)
└─ CascaderFooter (0..n)
```

## API reference

### Cascader

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `readonly CascaderNode[]` |  | The tree. Each node value is unique in the whole tree. |
| `value` | `readonly string[]` |  | The picked values (controlled): leaves, or full branches with `store="compact"`. |
| `defaultValue` | `readonly string[]` | NO_VALUES |  |
| `onValueChange` | `function` |  |  |
| `multiple` | `boolean` | false | Pick many values, with a box on each row. |
| `cascade` | `boolean` | true | Many values: a branch box takes every row under it (default `true`). |
| `show` | `CascaderShow` | "parent" | Many values: how a full branch shows as chips (default `parent`). |
| `store` | `"compact" \| "leaves"` | "leaves" | `leaves` (default): the value holds leaves. `compact`: a full branch is its own value. |
| `selectable` | `CascaderSelectable` | "leaf" | One value: `leaf` (default) picks only leaves; `any` lets Enter pick a branch too. |
| `max` | `number` |  | Many values: at most this many leaves. |
| `mode` | `CascaderMode` | "drill" | `drill` (default): one level at a time. `columns`: the levels side by side, until the page (a popup) or the panel's own box (`inline`) is too narrow for two columns. |
| `getChildren` | `CascaderGetChildren` |  | Loads the rows of a branch with `hasChildren`. |
| `onCreate` | `function` |  | Shows an "Add" row when a search finds nothing. |
| `open` | `boolean` |  |  |
| `defaultOpen` | `boolean` | false |  |
| `onOpenChange` | `function` |  |  |
| `inline` | `boolean` | false | No popup: the panel sits in the page (Filters, a side panel). |
| `disabled` | `boolean` | false |  |
| `readOnly` | `boolean` | false |  |
| `name` | `string` |  | The form name: one hidden input per value. |
| `form` | `string` |  |  |
| `labels` | `Partial<CascaderLabels>` |  |  |
| `levelNames` | `readonly string[]` |  | The names of the levels by depth, for the column heads ("Region", "Country", "City"). |
| `locale` | `string` |  | The locale of counts and of the search (case and word rules). |
| `children` | `ReactNode` |  |  |

### CascaderTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `size` | `ControlSizeAtLeastSm` | "default" |  |
| `placeholder` | `string` |  | The text while nothing is picked. Default: `labels.placeholder`. |
| `display` | `"leaf" \| "path"` | "path" | One value: the whole path (default) or only the picked node. |
| `aria-label` | `string` |  |  |
| `aria-labelledby` | `string` |  |  |
| `aria-invalid` | `boolean` |  |  |
| `id` | `string` |  |  |
| `clearable` | `boolean` | false | Show a × that clears the value (the clearable field). It sits beside the trigger button, not in it: a button may not hold a button. `className` sizes the field box. |
| `children` | `ReactNode` |  | The value part. Default: a `CascaderValue`. |

### CascaderValue

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `placeholder` | `string` |  |  |
| `display` | `"leaf" \| "path"` | "path" | One value: the whole path (default) or only the picked node. |
| `maxChips` | `number` | 2 | Many values: chips before the "+N" chip (default 2). |

### CascaderContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `children` | `ReactNode` |  | The panel. Default: a `CascaderPanel`. |
| `container` | `PopoverContentProps["container"]` |  | The popup and the phone sheet: where they render (a portal into this element). |
| `initialFocus` | `PopoverContentProps["initialFocus"]` |  | The popup and the phone sheet: what takes focus on open. Default: the search box. |
| `finalFocus` | `PopoverContentProps["finalFocus"]` |  | The popup and the phone sheet: where focus goes on close. |

### CascaderPanel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### CascaderSearch

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### CascaderViewSwitch

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### CascaderHeader

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### CascaderLists

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### CascaderFooter

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Cascader | `cascader-content` |  | `--anchor-width` |  |
| CascaderTrigger | `cascader-trigger` | `data-placeholder` |  |  |
| CascaderValue | `cascader-value` |  |  |  |
| CascaderContent | `cascader-content` |  | `--anchor-width` |  |
| CascaderPanel | `cascader-panel` |  | `--anchor-width` |  |
| CascaderSearch | `cascader-search` |  |  |  |
| CascaderViewSwitch | `cascader-view-switch` |  |  |  |
| CascaderHeader | `cascader-header-box` |  |  |  |
| CascaderLists | `cascader-lists` |  |  |  |
| CascaderFooter | `cascader-footer` |  | `--radius` |  |

## Usage

Pass the tree as `items`. Each node has a `value`, a `label`, and optional `children`. The value is always a `string[]`.

```tsx title="city-picker.tsx"
import { Cascader, CascaderContent, CascaderTrigger } from "@/components/ui/cascader";

const PLACES = [
  {
    value: "europe",
    label: "Europe",
    children: [
      { value: "berlin", label: "Berlin" },
      { value: "paris", label: "Paris" },
    ],
  },
  { value: "asia", label: "Asia", children: [{ value: "tokyo", label: "Tokyo" }] },
];

export function CityPicker() {
  return (
    <Cascader items={PLACES} defaultValue={["berlin"]} labels={{ placeholder: "Pick a city" }}>
      <CascaderTrigger className="w-72" />
      <CascaderContent />
    </Cascader>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/cascader
```

It adds 75 registry items: 72 files, 13508 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `@tanstack/react-virtual`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Animated Chevrons Up Down Icon](https://gelatinui.com/components/animated-chevrons-up-down-icon.md)
- [Button](https://gelatinui.com/components/button.md)
- [Checkbox](https://gelatinui.com/components/checkbox.md)
- [Drawer](https://gelatinui.com/components/drawer.md)
- [Highlight](https://gelatinui.com/components/highlight.md)
- [Kbd](https://gelatinui.com/components/kbd.md)
- [Popover](https://gelatinui.com/components/popover.md)
- [Segmented Control](https://gelatinui.com/components/segmented-control.md)
- [Skeleton](https://gelatinui.com/components/skeleton.md)
- [Spinner](https://gelatinui.com/components/spinner.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Select](https://gelatinui.com/components/select.md)
- [Combobox](https://gelatinui.com/components/combobox.md)
- [Drawer](https://gelatinui.com/components/drawer.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Enter, Space | On the trigger, opens the panel. |
| Up Arrow, Down Arrow | Moves the active row. |
| Home, End | With an empty search box, goes to the first or the last row. |
| Enter | Acts on the active row: opens a branch or picks a value. |
| Right Arrow | With the caret at the end of the text, opens the active branch. Right to left uses Left Arrow. |
| Left Arrow | With an empty search box, goes back one level. Right to left uses Right Arrow. |
| Space | With `multiple` and an empty search box, checks the active row. |
| Backspace | With an empty search box, drops the branch scope, or removes the last pick. |
| Escape | Clears the search. With an empty search box, closes the panel. |
| Enter, Space, Delete, Backspace | In the Selected view, removes the active pick. |

## Accessibility

Focus stays in the search box, and the active row moves through `aria-activedescendant`.

The arrow keys walk the rows and open or close a level. Enter picks a row.

Under 640px the surface is a bottom Drawer, and rows are large enough for a finger.

## Motion

| Part | Motion |
| --- | --- |
| Open | popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in and scales from 95% |
| Close | popup-exit · 120ms · ease-out (0, 0, 0.2, 1) |
