Skip to content
1 viewer
View
Component · Navigation

TreeView

cre8.primitive.tree-view

Hierarchical collection navigator for files, objects, runtime routes, and graph indexes.

Edit live
Category
Navigation
Slots
8
States
3
Writer
Shared

Preview

Live renderShared SSR + WASM writers

Project Workspace

  • src/
    • lib.rs
    • main.rs
    • router.rs
  • crates/
    • cre8-view
    • cre8-core
  • Cargo.toml
Workspace Hierarchy
  • 📁 src/lib.rs, main.rs, router.rs3 files
  • 📁 crates/cre8-view, cre8-core2 modules
  • 📄 Cargo.tomlManifest and dependenciesmanifest
<TreeView
  items={[
    {
      children: [
        { badge: "2.4KB", id: "lib.rs", kind: "file", label: "lib.rs" },
        { badge: "1.1KB", id: "main.rs", kind: "file", label: "main.rs" },
        { badge: "5.6KB", id: "router.rs", kind: "file", label: "router.rs" }
      ],
      defaultExpanded: true,
      id: "src",
      kind: "folder",
      label: "src/"
    },
    {
      children: [
        { id: "cre8-view", kind: "module", label: "cre8-view" },
        { id: "cre8-core", kind: "module", label: "cre8-core" }
      ],
      id: "crates",
      kind: "folder",
      label: "crates/"
    },
    { badge: "toml", id: "Cargo.toml", kind: "file", label: "Cargo.toml" }
  ]}
  title="Project Workspace"
>
  <List title="Workspace Hierarchy">
    <ListItem subtitle="lib.rs, main.rs, router.rs" title="📁 src/">
      <Badge intent="info" label="3 files" />
    </ListItem>
    <ListItem subtitle="cre8-view, cre8-core" title="📁 crates/">
      <Badge intent="neutral" label="2 modules" />
    </ListItem>
    <ListItem subtitle="Manifest and dependencies" title="📄 Cargo.toml">
      <Badge intent="success" label="manifest" />
    </ListItem>
  </List>
</TreeView>
Change this declaration and watch it render:open TreeView in the playground

Anatomy

The named parts of the rendered markup. Recipes style these hooks, and every renderer keeps them stable.

SlotDOM class
root.primitive-tree-view
tree—
item—
twisty—
icon—
label—
badge—
actions—
8 rows

States and platforms

The states the contract publishes, the platforms it declares, and the style recipes that dress it.

States
selectedexpandeddisabled
Platforms
webnativeruntime-node
Recipes
unstyledruntime-console

Renderers

Shared writer
TreeView renders through the one writer the server and the WASM DOM share, so both emit the same markup.

Every tag in the example above renders through a shared writer.

Declared adapters. A status is the manifest's declaration, not a measured parity result.

TargetRendererStatus
webreactexperimental
runtime-nodeview-nodeready
ssrhtml-navigationready
terminalterminal-textplanned
nativenative-adapterexperimental
5 rows

Accessibility

Follows the tree and treeitem keyboard navigation pattern.

  • Arrow keys move focus through visible tree items.
  • Left and Right collapse and expand branches.
  • Selected and expanded states are exposed through ARIA.