Eidetic

Cascader

Form
Input
Select

A multi-level dropdown selector for hierarchical data, with search, keyboard navigation, and path display.

Preview

Select from a hierarchical menu

Variants

Default and filled visual styles

Searchable

Enable search to find options across all levels

Props

Component API reference

PropTypeDefaultDescription
optionsCascaderOption[][]Hierarchical options with value, label, and optional children
valuestring[][]Selected value path as array of values
onChange(value: string[], selectedOptions: CascaderOption[]) => voidCallback when selection changes
placeholderstring'Select...'Placeholder text when no value selected
expandTrigger'click' | 'hover''click'How to expand child menus
changeOnSelectbooleanfalseAllow selecting non-leaf nodes
showPathbooleantrueShow full path in the trigger
separatorstring' / 'Path separator character
searchablebooleanfalseEnable search input in dropdown
multiplebooleanfalseAllow multiple selections
disabledbooleanfalseDisable the cascader
variant'default' | 'filled' | 'error''default'Visual variant
inputSize'sm' | 'md' | 'lg''md'Trigger button size
labelstringLabel text above the cascader
errorstringError message (switches to error variant)
helperTextstringHelper text below the cascader
classNamestringAdditional CSS classes

Usage

Import and implementation example

import { Cascader } from '@/components/ui/cascader'
import type { CascaderOption } from '@/components/ui/cascader'
const options: CascaderOption[] = [
{
value: 'us',
label: 'United States',
children: [
{
value: 'ca',
label: 'California',
children: [
{ value: 'sf', label: 'San Francisco' },
],
},
],
},
]
export default function Example() {
const [value, setValue] = useState<string[]>([])
return (
<Cascader
options={options}
value={value}
onChange={(val, opts) => setValue(val)}
label="Location"
searchable
/>
)
}

Features

Built-in functionality

  • Multi-level menus: Nested panel display for hierarchical data
  • Path display: Shows selected path with configurable separator
  • Search: Search across all levels with flattened results
  • Click or hover expand: Configurable trigger for expanding child menus
  • Clear selection: X button to clear the current selection
  • Three variants: Default, filled, and error visual styles
  • Three sizes: Small, medium, and large trigger sizes
  • Error and helper text: Built-in validation display
  • Disabled options: Individual options can be disabled

Accessibility

Accessibility considerations

ARIA Attributes

Trigger button is focusable and keyboard accessibleFocus ring wraps the trigger when open

Keyboard Navigation

KeyAction
Enter / SpaceOpen/close dropdown, select an option
EscapeClose dropdown (via click outside)

Notes

  • Dropdown closes when clicking outside the component
  • Active option is highlighted with distinct background
  • Chevron indicators show which options have children
  • Search input auto-focuses when searchable dropdown opens

Related Components