Tree select
Choose many things from a hierarchy in a field. Ticking a group ticks everything under it, a partly chosen group shows a dash, and the field shows as few chips as it can, so a whole department is one chip.
4 teams can see this dashboard.
When to use
- Sharing with teams in departments, targeting regions in countries, filtering by folders.
- Permissions and audiences.
When not to use
- Flat lists; use multi-select.
- Choosing one item at the end of a path; use the cascader.
Installation
pnpm dlx shadcn@latest add @caliper/tree-select
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
TreeSelect
6 props
summarise
0 props
No props of its own; it accepts the native props of its root element.
Keyboard
- ↓
- Moves to the next item or value.
- ↑
- Moves to the previous item or value.
- Home
- Jumps to the first item or the minimum.
- End
- Jumps to the last item or the maximum.
- →
- Moves to the next item or value.
- ←
- Moves to the previous item or value.
- Space
- Activates the focused control.
- Enter
- Activates the focused control.
Accessibility
It exposes treeitem, group and tree semantics, with aria-selected, aria-level, aria-checked, aria-expanded, aria-label and aria-multiselectable kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/tree-select.mdThe index of every part is at /llms.txt.