<!-- GENERATED by scripts/build-llms.mjs from llms/data.md — do not edit this file. -->

# `lr-file-tree`

- **Import** `import '@aceshooting/lyra-ui/components/lr-file-tree.js';` (stable tag alias; registers the tag)
- **Class** `LyraFileTree`, also available unregistered from `@aceshooting/lyra-ui/components/data/file-tree/file-tree.class.js`
- **Family** `components/data/` — see `llms/index.md` for its siblings
- **Status** `stable` since `4.0.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** none
- **Themeable via** 1 part, 0 custom properties — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-file-tree`

A file-explorer preset over `<lr-tree>` + `<lr-file-icon>`: path-keyed nodes with
git-status/diff-count badges, lazy directory loading, and select/open events.

An unreadable optional field rejects only that file record; it cannot reserve the path against a
later valid occurrence. Valid siblings retain their source order within the existing depth and
inspected-position budgets.

**Properties:** `nodes: readonly FileTreeNode[] = []` (attribute: false; clone-owned/frozen,
cycle-safe snapshot omitting empty/blank paths and retaining the first successfully admitted occurrence of each path, bounded to
the first 10,000 inspected source positions across 64 descendant levels; reassign after changes),
`selectedPath: string | null = null` (attribute `selected-path`), and `label?: string` — an
accessible-name override for the internal `<lr-tree>`, where omission reads back `undefined` and falls
back to the localized default while an explicitly empty string renders as an empty label.
`additions`/`deletions` are normalized once to finite nonnegative integers before localized visible
and accessible diff summaries. A host `aria-label` wins by presence when naming the internal tree,
including an explicit empty string; removing it restores `label` or the localized fallback.

**Methods:** `setChildren(path, children)` supplies a lazily-loaded directory's children.
`revealPath(path)` expands every ancestor directory and scrolls the target row into view, resolving
`true` once found. `expandAll()` and `collapseAll()` forward to the underlying `<lr-tree>`.

**Events:** `lr-file-select` (frozen readonly `detail: { filePath, node }`, a row was activated),
`lr-file-open` (frozen readonly `detail: { filePath, node }`, Enter/click on an already-selected file
row), and `lr-load-children` (frozen readonly `detail: { filePath }`, a lazy unloaded directory
expanded).

**CSS parts:** `base` — the root wrapper.
