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
- tests
- Cargo.toml
- README.md
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.
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.
oxyn add tree-viewUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Files
A repository tree with git badges.
- src
- auth
- mod.rsM
- token.rsA
- main.rs●
- lib.rs
- tests
- Cargo.toml
- README.md
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Compact
Compact rows without guides.
- src
- auth
- mod.rsM
- token.rsA
- main.rs●
- lib.rs
- tests
- Cargo.toml
- README.md
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Plain
No badges.
- src
- auth
- mod.rs
- token.rs
- main.rs
- lib.rs
- tests
- Cargo.toml
- README.md
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
TreeView
| Prop | Type | Default | Description |
|---|---|---|---|
nodesrequired | Vec<TreeNode> | — | Roots. |
expanded | Vec<String> | Default::default() | Open folders at first. |
selected | Option<String> | Default::default() | Selected id. |
label | String | "File tree" | Accessible name. |
guides | bool | true | Guide lines. |
density | String | "comfortable" | `comfortable` (36 px) · `compact` (28 px). |
on_select | EventHandler<String> | — | A row was activated. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| ↑ ↓ | Next / previous visible row |
| → | Open a folder, then into it |
| ← | Close a folder, then to its parent |
| HomeorEnd | First / last row |
| EnterorSpace | Select (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
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Children in | 200 ms | ease.out | instant |
| Chevron | 200 ms | overshoot | instant |
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
TreeViewfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
TreeViewElinoxyn_gpui. - Props to set first:
nodes. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.