Pass the tree as items. Each node has a value, a label, and optional children. The value is always a string[].
city-picker.tsx
Cascader
| Prop | Type | Default | Description |
|---|---|---|---|
| items | — | 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". |
| default | readonly string[] | NO_VALUES | |
| on | — | ||
| 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 | "all""child""parent" | "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 | "any""leaf" | "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 | "columns""drill" | "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. |
| get | CascaderGetChildren | — | Loads the rows of a branch with hasChildren. |
| on | — | Shows an "Add" row when a search finds nothing. | |
| open | boolean | — | |
| default | boolean | false | |
| on | — | ||
| inline | boolean | false | No popup: the panel sits in the page (Filters, a side panel). |
| disabled | boolean | false | |
| read | boolean | false | |
| name | string | — | The form name: one hidden input per value. |
| form | string | — | |
| labels | — | ||
| level | 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 |
|---|---|---|---|
| class | string | — | |
| size | "default""lg""sm" | "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
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| placeholder | string | — | |
| display | "leaf""path" | "path" | One value: the whole path (default) or only the picked node. |
| max | number | 2 | Many values: chips before the "+N" chip (default 2). |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
CascaderContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| children | ReactNode | — | The panel. Default: a CascaderPanel. |
| container | — | The popup and the phone sheet: where they render (a portal into this element). | |
| initial | — | The popup and the phone sheet: what takes focus on open. Default: the search box. | |
| final | — | The popup and the phone sheet: where focus goes on close. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CascaderPanel
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CascaderSearch
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CascaderViewSwitch
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CascaderHeader
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CascaderLists
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CascaderFooter
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| EnterorSpace | On the trigger, opens the panel. |
|---|---|
| Up ArroworDown Arrow | Moves the active row. |
| HomeorEnd | 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. |
| EnterorSpaceorDeleteorBackspace | In the Selected view, removes the active pick. |
Built with
Installs with Cascader
- Components
- Animated Chevrons Up Down Icon,Button,Checkbox,Drawer,Highlight,Kbd,Popover,Segmented Control+ 2 more





