Introduction
What the tree view packages give you (the behaviour, the keyboard model and the accessibility of a tree) and what stays yours.
Fragiola Tree (@fragiola/tree-react, @fragiola/tree-vue, @fragiola/tree-angular) is a
headless tree view for React 19, Vue 3.5 and Angular 22: file explorers, outlines, navigation menus, nested settings and permission
pickers. It ships the behaviour of a tree and its accessibility, as composable primitives over a
framework-free core.
Not on npm yet
The packages are not published on npm yet: these pages describe the upcoming first release.
What it gives you
- The WAI-ARIA tree view pattern.
role="tree",role="treeitem"androle="group", witharia-level,aria-posinset,aria-setsize,aria-expanded,aria-selected(with the selection feature),aria-checked,aria-disabledandaria-busy, and a roving tab stop: the tree is one stop in the page's tab order. - The keyboard. Arrows, Home and End, type-ahead, Enter and Space, Shift to extend a
selection,
*to expand siblings, F2 to rename and a keyboard drag, all overridable (Keyboard and type-ahead). - Selection and checkboxes.
none,singleormultipleselection (an opt-in feature: Features), and checkboxes that cascade (a parent is checked, unchecked or mixed) or stay independent. - Editing. Inline rename with validation, and drag and drop with Pointer Events (mouse, touch and pen alike), auto-expanding folders, auto-scroll and a drop indicator.
- Async children. A parent's children can come from your loader, called the first time it is expanded, with a loading state, an error state and a retry.
- A model. The tree is a JSON document, typed by your registry. Every change is a command through a middleware chain, so you can veto, rewrite or record anything a click, a key, a drop or an assistant does (The model and commands).
What stays yours
The packages ship no CSS, no icons, no text and no rendered menus:
- every visible word, including each item's label, which is raw data you render
(
{item.label}), and every accessible name (Accessible names); - every pixel: the parts expose their state as
data-*attributes and ARIA, and the depth as--tree-depth, and you style them with any tool (Styling the depth); - the markup: you own the recursion, so an item can render whatever it needs around its row (Composition);
- app policy: undo and redo, persistence, translations and the live region's announcements are your code. The examples show each of them as code to copy.
How it is built
A core, and one adapter per framework:
| package | what it holds |
|---|---|
@fragiola/tree | the core: the model (the document, its commands, get/is queries, middleware and events) and the engine (DOM focus, the keyboard, drag and drop, the async loader). No framework, zero runtime dependencies. |
@fragiola/tree-react | the Tree.* primitives and the hooks, and the whole core re-exported: a React app installs this one package. |
@fragiola/tree-vue | the same Tree.* primitives as Vue components and the composables, and the whole core re-exported: a Vue app installs this one package (Vue primitives). |
@fragiola/tree-angular | the same primitives as standalone Angular directives on your own elements, the injection functions, and the whole core re-exported: an Angular app installs this one package (Angular primitives). |
The model holds what is true with no screen (what is expanded, selected, checked, focused, being renamed); the engine is the one tree on screen (see Model and engine).
A taste
In a real application
Each example shows one feature; the Apps examples put several together, the way a product does:
- IDE explorer: a code editor's project tree, with icons per language,
git status, a lazy
node_modules, new files, rename, delete and drag under the project's rules, and open editors that follow the tree. - Warehouse inventory: a warehouse's locations five levels deep, a few thousand rows virtualized, with stock totals per subtree, low-stock flags, storage rules a drag obeys, and a details panel.
- Task board: projects, epics, tasks and subtasks, done when checked, with progress per parent, a board whose columns take rows dragged out of the tree, filters, inline add and undo.
- Permissions admin: a role's permissions as controlled cascade checks, with role presets, actions locked by policy, the changes against the saved grants, a search, and a confirmation before risky grants.
Next
- Installation
- Your first tree
- Known limitations: no virtualization yet, no drag between two trees.