React Native · Components
Cascader
Cascading picker (same API as web's Cascader): leveled choices such as province → district → neighborhood or category → subcategory.
3 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
Code
Events
- Events appear here when you interact with the preview.
Import
Cascader
componentCascading picker (same API as web's Cascader): leveled choices such as province → district → neighborhood or category → subcategory. On phones a single column in a bottom sheet, proceeding level by level and going back with the button at the top; on tablets columns open side by side.
- Value: a path array (
["istanbul", "kadikoy"]); the box shows "İstanbul / Kadıköy". WithchangeOnSelectintermediate levels are selectable too. - Loading:
hasChildrenoptions are fetched vialoadChildrenwhen opened; a spinner in the row, "Try again" on error. - Search: with
search, across all loaded paths, insensitive to Turkish letters. - Form: bound inside
Formvianame.
Examples
CascaderOption
interfaceAn option in Cascader (same as web).
| Name | Type | Description |
|---|---|---|
value | string | Unique value at this level; the path is made of these values. |
label? | string | Display name. Defaults to value. |
icon? | IconProp | Icon at the start of the name. |
description? | ReactNode | Small description below the name. |
children? | readonly CascaderOption[] | Child options. |
hasChildren? | boolean | Child options are not loaded yet but exist; requested via loadChildren when opened. |
disabled? | boolean | Cannot be selected. |
CascaderProps
interfaceProps of Cascader (same names as web).
Extends: FieldProps
| Name | Type | Default | Description |
|---|---|---|---|
options | readonly CascaderOption[] | Option tree (e.g. province → district → neighborhood). | |
value? | readonly string[] | Selected path in controlled use (["istanbul", "kadikoy"]); [] for none. | |
defaultValue? | readonly string[] | Initial path in uncontrolled use. | |
onValueChange? | (path: string[], options: CascaderOption[]) => void | When the selection changes, with the path and the options on it ([] when cleared). | |
loadChildren? | (option: CascaderOption, path: readonly CascaderOption[], signal: AbortSignal) => Promise<readonly CascaderOption[]> | Fetches child options when a hasChildren option is opened. The result is kept; on error "Try again" appears. | |
changeOnSelect? | boolean | false | Can intermediate levels be selected too? |
search? | boolean | false | Search box: searches all loaded paths ("kadı" → "İstanbul / Kadıköy"). |
separator? | string | " / " | Separator of the path in the box. |
renderValue? | (options: CascaderOption[]) => ReactNode | How the path appears in the box. | |
placeholder? | string | "Seçiniz" | Text shown when nothing is selected. |
icon? | IconProp | Icon at the start of the box. | |
clearable? | boolean | false | Clear button. |
variant? | FieldVariant | "outline" | Field variant. |
open? | boolean | Whether the panel is open, for controlled use. | |
onOpenChange? | (open: boolean) => void | When the panel opens or closes. | |
aria-label? | string | Screen reader name; give it if there is no visible label. | |
style? | StyleProp<ViewStyle> | Container style. |