fetaUI
GitHub

Tree

Hierarchies in a Soft card: files, navigation with counts, checkboxes with parent states, and indent guides.

FreeWeb and Mobile4 variantsMotion

Preview

npx shadcn add @fetaui/tree
Playground
Explorer
src
components
Button.tsx
Dialog.tsx
index.ts
package.json
Tree Item
components24
files
Explorer
src
components
Button.tsx
Dialog.tsx
index.ts
package.json
navigation
Workspace
Inbox12
Projects3
Website refresh8
Mobile app21
Billing v25
Archive
checkbox
Regions2 of 6 selected
All regions
Europe
Zürich
Lisbon
North America
Asia Pacific
guides
Explorer
design-system
tokens
color.json
space.json
icons
rounded.svg
Kind
Icons animation
Motion

Installation

Terminal· bash
 npx shadcn add @fetaui/tree

Accessibility

  • Uses tree and treeitem with aria-level, aria-expanded and aria-selected.
  • One tab stop, with arrow keys inside.
  • Checkbox parents report mixed.

Motion

  • Children fade in and settle 4 px over 240 ms, and the chevron turns.
  • The card rises 8 px over 400 ms on first render.
  • With reduced motion, rows appear in place.

Responsive behavior

  • 280 wide on Web and 358 on Mobile. Rows are 32 and 44 px.

Performance

  • Rows are a memoized flat list, and closed branches do not render.
  • Rows are not virtualized, so very large trees should open lazily.

Note for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Import Tree, TreeCard and TreeItem from @/components/fetaui/tree after installing it. nodes and label are required.
  • Node ids must be unique across the whole tree. kind is files, navigation, checkbox or guides.
  • expanded, selected and checked each have a default and a change callback. Choosing a branch selects and toggles it.
  • In checkbox kind, checked holds leaf ids and parents work out their own state. Disabled nodes never tick. Composes Checkbox.

Related