Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

fs

Filesystem composite widgets — pure builders that turn VFS listing data into widget trees. Four stateless pieces every caller composes with their own state + polling.

Exports

  • M.tree(roots, opts) -> WidgetNode — folder tree (recursive) built on Z.tree with VFS-friendly defaults.
  • M.fileList(entries, opts) -> WidgetNode — flat list of files; folders first; selected file highlighted.
  • M.preview(data, opts) -> WidgetNode — file preview pane (text or note).
  • M.breadcrumb(path, opts) -> WidgetNode — clickable path crumbs.

Usage

local Fs = require("@builtin::modules.zui.widget.fs")

return Z.hbox({
    Fs.tree(state.roots, { onSelect = "files-tree-select" }),
    Fs.fileList(state.entries, { onSelect = "files-row", selectedKey = state.name }),
    Fs.preview({ name = state.name, text = state.text }, { id = "files-preview" }),
})

Notes

  • All four builders are stateless: pass data in, get a widget tree out. They never touch the VFS — the caller owns reads, listing, and cache eviction.
  • Z.fs.* is what Layer B (engine/ui/file_manager) and Layer C (system_tools' "Files" tab) compose with their own polling. You can build your own file-browser by composing these directly.