TreeItem
One flat row of a tree or nested-list UI — chevron, checkbox, icon, title, and a trailing extras slot.
Usage
import { TreeItem } from '@acronis-platform/ui-react';TreeItem is a single row of a tree or nested list: an optional expand chevron,
an optional Checkbox, an optional leading icon, the row
title, and an optional trailing extras slot for children. Every slot is gated
by its own boolean, mirroring the Figma component's properties —
isExpandable (on by default), hasCheckbox, hasIcon, hasExtras (on by
default). A separate expanded boolean rotates the chevron to point down.
Use Tree to compose rows into a hierarchy with expansion,
selection, and keyboard navigation.
isExpandable and expanded are artwork, not behavior. The first draws
the chevron; the second rotates it a quarter turn to point down. Nothing
expands when you click it, and there is no change event — the Figma node's
expandable slot has no interaction either, so the consumer holds the open
state and renders the child level itself. Pass expanded from the same
boolean that feeds your aria-expanded: the chevron shows the state to
sighted users, aria-expanded announces it, and setting only one leaves them
disagreeing.
selected is a look you drive. The row never selects itself on click; it
only reflects the flag and exposes data-selected. The selected fill persists
on hover. Pressing a row or focusing it with the keyboard uses the same fill.
Keyboard focus adds an inset focus ring.
The row defaults to a plain div and is polymorphic through the Base UI
render prop. When used in Tree, the container supplies the treeitem role
and roving tab stop. On a standalone row, the checkbox's aria-label defaults to
title. Use checkboxProps to configure the checkbox as you would a standalone
Checkbox.
@acronis-platform/tokens-pd ships no Tree component tier — the Figma
node's variables still sit in the pre-next-gen componentLegacy/tree/*
namespace. So the row's colors come from the semantic tier
(--ui-text-on-surface-primary, --ui-glyph-on-surface-primary,
--ui-background-surface-hover / --ui-background-surface-active,
--ui-focus-primary) and its layout numbers are plain utilities matching the
design's pixel values. Both get re-pointed when a --ui-tree-item-* tier
lands.
Examples
For a complete tree, see the Tree examples.
A multi-select row — the checkbox is controlled through checkboxProps:
<TreeItem
hasCheckbox
hasIcon
title="Machines with agents"
checkboxProps={{
checked,
onCheckedChange: (value) => setChecked(Boolean(value)),
}}
/>A row with a trailing action, and a leaf row with no chevron:
<TreeItem hasIcon title="Backups">
<ButtonIcon aria-label="Rename">
<PencilIcon size={16} />
</ButtonIcon>
</TreeItem>
<TreeItem isExpandable={false} hasIcon title="readme.md" />hasExtras={false} removes the trailing slot and its children from the DOM —
a button in there does not exist, so it cannot be tabbed to:
<TreeItem hasExtras={false} title="Workloads">
<Tag variant="info">12</Tag> {/* not rendered */}
</TreeItem>API Reference
Prop
Type