$ rezi
Widgets

FileTreeExplorer

Tree view specialized for file/directory nodes with icons and optional git status.

Tree view specialized for file/directory nodes with icons and optional git status.

Usage

ui.fileTreeExplorer({
  id: "explorer",
  data: state.data,
  expanded: state.expanded,
  selected: state.selected,
  showIcons: true,
  showStatus: true,
  onToggle: (node, expanded) => toggleNode(node, expanded),
  onSelect: (node) => selectNode(node),
  onActivate: (node) => openNode(node),
})

Props

PropTypeDefaultDescription
idstringrequiredWidget identifier
dataFileNode | FileNode[]requiredTree data (no filesystem access in core)
expandedstring[]requiredExpanded node paths
selectedstring-Selected node path
focusedstring-Focused node path
showIconsbooleantrueShow file icons
showStatusbooleantrueShow git status indicators
indentSizenumber2Indentation per depth level
onToggle(node, expanded) => voidrequiredExpand/collapse callback
onSelect(node) => voidrequiredSelection callback
onActivate(node) => voidrequiredActivate callback (Enter/double-click)
onContextMenu(node) => void-Context menu callback
renderNode(node, depth, state) => VNode-Custom renderer

Behavior

  • Arrow keys navigate. Enter activates the focused node.
  • Right click on a node calls onContextMenu(node) when provided.

Notes

  • FileNode includes name, path, type, and optional children and status.
  • status values: "modified", "staged", "untracked", "deleted", "renamed".
  • Use renderNode to customize icons, colors, or badges.

On this page