Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

Styling contract

Headless tree styling relies on slot and state attributes from the primitives. Those hooks are enough to build file explorers, settings panes, and navigation trees without coupling to private markup.

CSS contract table

SelectorApplied onPurpose
[data-slot='tree']Root controllerOverall tree typography, spacing, and interactive scope.
[data-slot='tree-item']Each nodeRow padding, cursor, and node-level affordances.
[data-slot='tree-group']Child branch containerIndentation, connector lines, and nested layout.
[data-slot='tree-indicator']Disclosure affordanceChevron rotation, icon swap, or branch marker styling.
[data-expanded='true' | 'false']Item and indicatorBranch visibility and indicator-state styling.
[data-selected='true']Selected itemSelection highlight and emphasis treatment.
[data-disabled='true']Disabled itemMuted or blocked presentation for disabled nodes.

Branch visibility

The primitive reflects branch state through data-expanded, but it does not hide child groups for you. Most headless trees need a rule like [data-slot='tree-item'][data-expanded='false'] > [data-slot='tree-group']{ display: none; } so collapsed branches stop rendering.

State selectors

  • Use :focus-visible on [data-slot='tree-item'] for roving-focus indication.
  • Style [data-selected='true'] on the node row, not just the indicator, so current selection reads clearly.
  • Pair [data-disabled='true'] with reduced opacity and a non-interactive cursor.
  • When visible labels are terse, provide richer aria-label values because typeahead reads them first.