IndexLayout
An index layout: a tab select on top and a stack of tab panels below. Suits settings pages — "top tabs + chunked content"; for the side-outline variant see BookletLayout.
Basic usage
An options item is { value, label, children } plus the TabPanelLayout panel fields (with disabled to disable a tab); the active tab rides the value / defaultValue / onChange channels. Tabs and panels are wired with aria-controls / aria-labelledby automatically.
In the expanded form (on by default) the layout fills its parent via absolute positioning, so the parent must be positioned and sized (the demo wrapper above exists for exactly that). The expanded={false} static form works only for MenuLayout's own flow content — the panel stacks of this component and BookletLayout are absolutely positioned panels with no content height in static mode, so don't use it here.
Browser-search linkage
openMatchedPanels (default true) hides inactive panels with hidden="until-found": when the browser's in-page search (Ctrl+F) matches content inside a hidden panel, the corresponding tab is activated automatically. Under continuous all panels show at once and openMatchedPanels is disabled — panels are no longer hidden with until-found and the browser-search linkage stops. autoFocus (default true) focuses the panel's first focusable element after a switch (suppressed in the mobile form).
When the active tab is removed, the first selectable (non-disabled) tab is auto-selected.
API
Inherits all MenuLayout props (except menu / menuPosition / children), plus:
See also
- The fields of a single tab panel: TabPanelLayout
- The side-outline variant: BookletLayout
- The
hidden="until-found"three states: Layout