fndn/ui

Components

Tree View

Beta

A hierarchy of rows that open and close, such as files and folders.

Details

A hierarchy of rows that open and close: files and folders, nested settings, an outline. Rows are the sidebar nav's (32px at size md, 14px/500 ink-2, control radius, the one gliding hover highlight, the current row filled hover-2 in ink); a branch carries the collapsible's caret that turns down and opens with the collapsible's reveal; each level is indented by the caret's box and gap (26px at md) with a hairline guide under its parent's caret, drawn in ink-3 for the level that holds the selection. A row's fill, focus ring and hover highlight start where its level starts, so no guide is ever under them, while the whole row stays clickable. size puts the rows on the control scale (xs 24 for the dense side pane of a code editor's explorer, sm 28, md 32, lg 36) and changes dimensions only (the radius steps with the height: chip up to 28px, control from 32). Behaviour and ARIA from the Zag tree-view machine through Ark UI.

Behaviour from Ark UI, the tree-view machine of Zag.