GitHub

Tree

Hierarchical tree view with selection modes and htmx lazy loading.

<rhx-tree>

Examples

Basic

Documents
README.md
LICENSE

Multiple Selection

Apple
Banana
Cherry

Leaf Selection Only

Frontend
React
Vue
Angular

States

Available
Selected item
Normal item

htmx Lazy Loading

Static leaf item

Properties

Property Type Default Description
rhx-selection string single Selection mode: single, multiple, leaf
aria-label string - Accessible label for the tree

Accessibility

  • The tree container uses role="tree" with each node using role="treeitem".
  • Branch nodes use aria-expanded to indicate whether they are open or closed.
  • Arrow key navigation moves focus between items: Up/Down for siblings, Left to collapse or move to parent, Right to expand or move to first child.
  • Selected items are marked with aria-selected for screen reader announcement.