Pro
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.
pnpm dlx shadcn@latest add @caliper/tree-selectWhen to use
Use it for
- Sharing with teams in departments, targeting regions in countries, filtering by folders.
- Permissions and audiences.
Skip it when
- Flat lists; use multi-select.
- Choosing one item at the end of a path; use the cascader.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Tree keys
- Up and Down move, Right opens, Left closes or goes to the parent, Space ticks.
- Search keeps the path
- A match keeps every group above it open, so people see where it lives.
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.
Usage
Import it from your copy of the source. The example behind the preview comes with the source. It is built from TreeSelect and summarise.
import { TreeSelect, summarise } from "@/components/ui/tree-select"
The worked example comes with Pro
The 31-line example behind the preview opens here, ready to copy.
- 576 Pro parts, blocks and page templates, all with source
- $199 once, with a year of updates. What you have stays yours
- A full refund within 14 days if it is not for you
API reference
TreeSelect
component
summarise
component
No props of its own; it accepts the native props of its root element.
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.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.