Accordion
Disclosure list for short related sections: one open at a time, or several with type multiple.
Nested hierarchy people open and close level by level to browse, pick, or check items.
A nested list people open and close level by level, like teams in an organization, project folders or account hierarchies, to pick or check items.
The advanced tree: selection multiple, icons, guide lines and reorderable. Variants shows the simple one. Click chevrons to open folders; drag the grip or use Alt+arrow keys to move rows.
Use TreeView for data that nests: folders and files, an org chart, parent and child accounts, product categories. Simple is chevrons and guide lines, one row selected. Advanced is selection multiple, kit checkboxes, folder icons, and reorderable with a grip Move menu. Do not use it for a flat list, app navigation, or page sections that open and close.
import { TreeView } from "agentic-ds-kit";From contracts/treeview.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| items | array | Yes | — | A node with children (even []) is a folder. Omit children on a leaf. Optional icon when showIcons. A curated Lucide name (PascalCase or kebab-case) renders instantly; any other Lucide name needs import "agentic-ds-kit/icons-on-demand" once (otherwise it is skipped with a dev warning). Or pass the Lucide component (Plus) or an element. |
| label | string | Yes | — | Accessible name for role=tree |
| size | sm | md | No | md | — |
| selection | none | single | multiple | No | none | — |
| expanded | string[] | No | — | controlled folder ids |
| defaultExpanded | string[] | No | — | uncontrolled initial folder ids |
| onExpandedChange | function | No | — | (expanded: string[]) => void |
| selected | string[] | No | — | controlled node ids. Single keeps 0 or 1 id. Ignored when selection is none. |
| defaultSelected | string[] | No | — | uncontrolled initial node ids |
| onSelectedChange | function | No | — | (selected: string[]) => void |
| showLines | boolean | No | false | — |
| showIcons | boolean | No | false | Folder, FolderOpen, and File via LucideByName. Not Material Symbols. |
| reorderable | boolean | No | false | Grip handle with drag-and-drop, Move menu, and Alt+Arrow moves among siblings or in/out of folders. Calls onItemsChange. |
| onItemsChange | function | No | — | (items: TreeViewItem[]) => void when reorderable moves a node |
Disclosure list for short related sections: one open at a time, or several with type multiple.
Single show/hide panel.
Product side nav: brand header, icon items, optional badges, closeable; variant single (one column that closes to an icon rail) or rail-subnav (a fixed icon rail plus a SideNav.SubNav column with the picked parent's rows).
Docs and catalog sidebar only: title, grouped text-only links, optional decorative icons and muted counts on group and subgroup headers only, an active page pill and optional footer links.