Tree
The outline marks keyboard focus; filled rows mark accepted selection. Arrows only move focus except branch-opening/closing arrows; Space selects, Enter activates once. The disclosure button changes expansion without activating its row. The two Readme labels have distinct stable keys, and the disabled Shared parent does not disable its enabled descendant.
Turn off acceptance controls to inspect rejected expansion or selection proposals. Protected action cancels activation before incrementing the counter or selecting. Reorder source children to exercise keyed focus with updated visible order. Collapse Source while a child is selected: the selected key remains, although no hidden row is tabbable. External collapse must not steal focus from its button; a collapse that actually hides a focused descendant repairs focus inside the tree.
The RTL control reverses logical branch arrows, not selected identity. Native Tree owns all navigation and repair; the recipe owns only application state and rendering. Extra folder glyphs, if you add them, are presentation and do not create a primitive dependency.
For an ordinary sidebar of links, prefer a disclosure list. Tree deliberately excludes arbitrary embedded tab controls, routing, loading, filesystem operations, virtualization and multi-selection. Partial-data ARIA metadata remains the author's responsibility.
See all parts, keyboard details and three standalone styling downloads. This recipe requires the published Primitives 0.1.0-rc.4 release candidate, not historical rc.2; use the exact-version npm installation instructions.