← Back

Tree

[intermediate]

Expandable tree view with keyboard navigation

Tree Demo

Expandable tree view with keyboard navigation

For the full interactive experience:

$ mix raxol.playground

Code
{:ok, tree} =
  Tree.init(
    id: :playground_tree,
    nodes: [
      node(:src, "src", [
        node(:app, "app.ex"),
        node(:lib, "lib", [
          node(:utils, "utils.ex"),
          node(:core, "core.ex")
        ])
      ]),
      node(:test, "test", [node(:helper, "test_helper.exs")]),
      node(:mix, "mix.exs"),
      node(:readme, "README.md")
    ]
  )

# Keys route through Tree.handle_event/3; Tree.render/2 draws it.
demo j/k prev/next / focus demo esc back 14/42 demos