Skip to content

Tree viewPro

Nested folders with keyboard navigation, rows that stagger in when a folder opens, guide lines and git or agent status badges.

oxyn add tree-view
  • src
  • auth
  • mod.rsM
  • token.rsA
  • main.rs●
  • lib.rs
  • Cargo.toml
  • README.md
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • Files and folders an agent touched, project navigation, nested settings.

When not to use

  • An app sidebar: use Sidebar instead.
  • A workspace sidebar: use Workspace sidebar instead.
  • A resizable sidebar that snaps to a 64 px icon rail, with a keyboard splitter and a breadcrumb that follows the page: use Sidebar rail instead.

Installation

Tree view is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add tree-view

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Files

A repository tree with git badges.

  • src
  • auth
  • mod.rsM
  • token.rsA
  • main.rs●
  • lib.rs
  • Cargo.toml
  • README.md
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Compact

Compact rows without guides.

  • src
  • auth
  • mod.rsM
  • token.rsA
  • main.rs●
  • lib.rs
  • Cargo.toml
  • README.md
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Plain

No badges.

  • src
  • auth
  • mod.rs
  • token.rs
  • main.rs
  • lib.rs
  • Cargo.toml
  • README.md
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

TreeView

PropTypeDefaultDescription
nodesrequiredVec<TreeNode>—Roots.
expandedVec<String>Default::default()Open folders at first.
selectedOption<String>Default::default()Selected id.
labelString"File tree"Accessible name.
guidesbooltrueGuide lines.
densityString"comfortable"`comfortable` (36 px) · `compact` (28 px).
on_selectEventHandler<String>—A row was activated.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
↑ ↓Next / previous visible row
→Open a folder, then into it
←Close a folder, then to its parent
HomeorEndFirst / last row
EnterorSpaceSelect (and toggle a folder)
*Expand sibling folders

Accessibility

  • tree / treeitem with aria-level, posinset, setsize, expanded and selected.
  • Roving tabindex; icons, chevrons and guides are aria-hidden.
From the spec

tree / treeitem with level, position, set size, expanded and selected; roving tab index; icons and guides aria-hidden.

Motion & interaction

Opening a folder staggers its children in; chevrons rotate on a snappy spring; the selection fill transitions between rows.

Timing
TransitionDurationEasingReduced motion
Children in200 msease.outinstant
Chevron200 msovershootinstant

Responsive behaviour

  • 36 px rows (28 compact), labels ellipsize, 18 px per level.
Edge cases (spec)

Labels ellipsize; 18 px per level so very deep trees lose label room. Empty folders still toggle.

Notes for AI

  • Import TreeView from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: TreeViewEl in oxyn_gpui.
  • Props to set first: nodes.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI