Component docs
Loading
"use client";
import { Cascader } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
items (required) | readonly TreeItem[] | — | Items to render. |
defaultValue | readonly string[] | — | Initial value when uncontrolled. |
onValueChange | (value: string[]) => void | — | Called with the new value (only when it changes). |
value | readonly string[] | — | Current value (controlled); null where it means "nothing selected". |
itemsrequiredreadonly TreeItem[]
Items to render.
defaultValuereadonly string[]
Initial value when uncontrolled.
onValueChange(value: string[]) => void
Called with the new value (only when it changes).
valuereadonly string[]
Current value (controlled); null where it means "nothing selected".
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const items = [
{ id: "assets", label: "Assets", children: [{ id: "images", label: "Images" }] },
{ id: "exports", label: "Exports" },
];
<Cascader items={items} />