Tree
macOS 27 Outline View-style tree with expand / collapse, single selection and cascading checkboxes, plus a TreeSelect that opens a Liquid Glass menu on desktop and an iOS 27 bottom Drawer on mobile.
Two components for hierarchical data that both read plain { id, label | name, children } objects (or anything else via getId / getChildren / renderLabel):
Tree: an outline list with expand / collapse (height-animated, honoringprefers-reduced-motion), single selection, and checkboxes with parent / child cascading and an indeterminate state. Rows are28px / 13pxon desktop (macOS 27 Outline View) and44pt / 16pton mobile (iOS 27 touch target). Full keyboard support:↑ ↓move,← →collapse / expand (← on a collapsed row jumps to its parent),Home / End,Enter / Spaceselect or check.TreeSelect: picks one node from a tree. The trigger is identical toSelectTrigger(glass capsule, Bordered or Over-Glass). Desktop (>= 768px) opens a14pxLiquid Glass menu whose rows use the macOS Menu Item accent highlight; mobile (< 768px) opens the standard iOS 27 bottom Drawer.- Mobile (
< 768px· iOS 27): both switch to drill-down navigation, like the Files app or GitHub on a phone — one level per page in Inset Grouped cards; a parent row ends in›and pushes its children in with a slide, and a back button returns. It opens at the level that holds the selected node. In single-select mode every selectable row has a leading radio: the radio picks the node where it is listed (parents included), while tapping a parent row opens it; leaves are picked by tapping anywhere on the row.expandedIdsonly applies to the desktop outline.
Navigation Tree
showSelectedCheck={false} highlights the selected row as a whole, like an active Sidebar item. getSelectable keeps folders from being selected — clicking them only toggles them open. renderIcon receives the expanded state, so folders can swap icons:
Installation (Shadcn Registry)
# Install via the @apple-liquid namespace (includes checkbox, popover, select and liquid-glass)
npx shadcn@latest add @apple-liquid/tree
# Or install directly via URL
npx shadcn@latest add https://your-domain.com/r/tree.jsonCheckboxes
checkable turns on multi-select. Checking a parent checks every enabled child; a parent becomes checked once all its children are and shows the indeterminate state otherwise. Disabled children keep their state — in that case the next click on the parent unchecks the rest. checkStrictly decouples parents and children. checkedIds only lists fully checked nodes:
TreeSelect
Supports controlled / uncontrolled value, allowClear, size="sm", disabled, and native form submission through name / required (a hidden input). Pass the field label as title for the mobile Drawer header.
multiple switches to checkboxes with the same parent / child cascading as Tree (checkStrictly turns it off); value becomes string[]. The trigger lists only the top-most picks — a fully checked parent stands for its whole subtree — as the first one plus a +N count. The desktop menu stays open while checking; the mobile Drawer gets a Done button, and name submits one hidden input per id:
Usage
import { Tree, TreeSelect } from '@/components/ui/tree';
const data = [
{
id: 'eng',
name: 'Engineering',
children: [
{ id: 'web', name: 'Web' },
{ id: 'ios', name: 'iOS' },
],
},
];
export function Example() {
const [checked, setChecked] = React.useState<string[]>([]);
const [team, setTeam] = React.useState<string | null>(null);
return (
<>
<Tree data={data} checkable checkedIds={checked} onCheckedChange={setChecked} />
<TreeSelect
data={data}
value={team}
onValueChange={setTeam}
placeholder="Choose a team"
title="Team"
allowClear
/>
</>
);
}Props API
Tree
| Prop | Type | Default | Description |
|---|---|---|---|
data | T[] | — | Root nodes |
getId / getChildren | (node) => string / (node) => T[] | node.id / node.children | Read the id and children of a node |
renderLabel | (node) => ReactNode | node.label ?? node.name | Row content |
renderIcon | (node, { expanded }) => ReactNode | — | Leading icon (accent-tinted by default) |
getDisabled / getSelectable | (node) => boolean | — | Disable a row / keep a node from being selected |
expandedIds / defaultExpandedIds / onExpandedChange | string[] / string[] | 'all' | 'all' | Expansion state (desktop outline; mobile drills down instead) |
selectedId / defaultSelectedId / onSelect | string | null / (id, node) => void | — | Single selection; enabled by passing any of them |
showSelectedCheck | boolean | true | Trailing checkmark on desktop, leading radio on mobile; false highlights the whole row instead |
checkable | boolean | false | Turn on checkboxes |
checkedIds / defaultCheckedIds / onCheckedChange | string[] | [] | Fully checked nodes |
checkStrictly | boolean | false | Parents and children are checked independently |
glass | boolean | Inherited | Material of the checkboxes |
disableMotion | boolean | false | Disable the expand / collapse animation |
TreeSelect
Accepts data, getId, getChildren, getDisabled, getSelectable, renderLabel, renderIcon, defaultExpandedIds and disableMotion like Tree, plus:
| Prop | Type | Default | Description |
|---|---|---|---|
multiple | boolean | false | Multi-select with checkboxes |
value / defaultValue / onValueChange | string | null (string[] with multiple) | null / [] | Selected node id(s); null / [] when cleared |
checkStrictly | boolean | false | With multiple: no parent / child cascading |
placeholder | ReactNode | 'Select' | Trigger text while nothing is selected |
title | ReactNode | 'Select' | Mobile Drawer header |
emptyText | ReactNode | 'No options' | Shown when data is empty |
allowClear | boolean | false | Clear button on the trigger |
size | 'default' | 'sm' | 'default' | Same steps as SelectTrigger |
glass | boolean | true | Glass trigger and menu; false renders both 100% opaque |
name / required / disabled | — | — | Form integration (hidden input) |
contentClassName | string | — | Classes for the desktop menu / mobile Drawer |
Language & Text
Tree, TreeSelect accept locale and messages, which apply to all of its parts and the overlays it opens and win over the global <LiquidGlassProvider locale messages>. To override the text globally, put it under messages.tree on the provider. See Liquid Glass → Global settings.
| Prop | Type | Description |
|---|---|---|
locale | LiquidGlassLocaleInput | UI language of this component (any BCP 47 tag; unsupported ones fall back to English) |
messages | Partial<TreeMessages> | Text overrides, merged over the built-in text and the global messages.tree |
| Key | Built-in text (English) |
|---|---|
title | Select |
empty | No options |
clear | Clear |
back | Back |
done | Done |
Trace
AI and task execution step list featuring running shimmer, destructive red error state, translucent pending state, and collapsible step details.
Upload
Apple Liquid Glass file upload component with a refined default dropzone, drag-and-drop, file validation, upload progress, and full custom trigger support.