Cascader

A hierarchical selector for multi-level data like locations or categories.

When to Use

  • For selecting from nested option trees (country > state > city)
  • When options have a clear parent-child hierarchy
  • For category or department selection

Import

import { Cascader } from "orizon";

Examples

Basic

<Cascader
  options={[
    {
      value: "us",
      label: "United States",
      children: [
        { value: "ny", label: "New York" },
        { value: "ca", label: "California" },
      ],
    },
  ]}
  placeholder="Select location"
  onChange={(value) => console.log(value)}
/>

Multiple Selection

<Cascader multiple options={options} placeholder="Select categories" />

Searchable

<Cascader showSearch options={options} placeholder="Search..." />

API

CascaderProps

  • optionsCascaderOption[] — Hierarchical option data
  • valuestring[][] — Selected path(s) (controlled)
  • defaultValuestring[][] — Default selection
  • onChange(value, selectedOptions) => void — Selection handler
  • multipleboolean — Allow multiple selections (default: false)
  • showSearchboolean — Enable search (default: false)
  • expandTrigger"click" | "hover" — How sub-menus expand (default: "click")
  • changeOnSelectboolean — Allow selecting parent nodes (default: false)
  • loadData(selectedOptions) => void — Async data loading
  • placeholderstring — Placeholder text
  • disabledboolean — Disable the cascader
  • size"small" | "middle" | "large" — Size
  • status"error" | "warning" — Validation status
  • allowClearboolean — Show clear button (default: true)

CascaderOption

  • valuestring | number — Option value
  • labelReactNode — Display text
  • childrenCascaderOption[] — Child options
  • disabledboolean — Disable option
  • isLeafboolean — Mark as leaf node (no children to load)