Data Entry

Cascader

A multi-level select component that unfolds hierarchically — category → subcategory → value. Ideal for location pickers, category trees, and nested classifications.

Installation

npx benflux-ui add cascader

Hover to expand

<Cascader
  options={options}
  expandTrigger="hover"
  separator=" > "
  placeholder="Hover to expand..."
/>

Props

PropTypeDefaultDescription
options*CascaderOption[]Hierarchical option tree
valuestring[]Controlled value — array of keys from root to selected leaf
defaultValuestring[][]Initial value (uncontrolled)
onChange(value: string[], selectedOptions: CascaderOption[]) => voidCalled when a leaf option is selected
placeholderstring"Select..."Trigger placeholder
allowClearbooleanfalseShow a clear button
separatorstring" / "Character used to join label segments in the trigger
expandTrigger"click" | "hover""click"How child menus are opened
disabledbooleanfalseDisable the trigger
notFoundContentstring"No options"Shown when a menu is empty

CascaderOption

interface CascaderOption {
  value: string
  label: string
  disabled?: boolean
  children?: CascaderOption[]
}