StackLayout
A stack layout: renders a set of pages from options, showing only the active page at a time; with continuous, all pages are visible and the container scrolls. Also the inner page stack of BookletLayout.
Basic usage
The active page rides the value / defaultValue / onChange channels; an option is a PageLayout prop set plus value (which doubles as the match key and the list key).
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 whole-container scrolling of continuous rides on the same premise. The expanded={false} static form works only for MenuLayout's own flow content — this component's pages are absolutely positioned panels with no content height in static mode, so don't use it here.
When the active value is missing or stale (e.g. its page was removed), a page is auto-selected: the next surviving page, or the new last page when the last one was removed; when no value was ever given or the value is not among the options, the first usable page is taken.
Continuous mode
continuous makes all pages visible with the container scrolling as one; onPageFocus fires when focus enters a page (without changing the active value), which you can use for scroll-linked page selection.
API
Inherits all PanelLayout props, plus:
See also
- The fields of a single page: PageLayout
- The wrapper with an outline menu: BookletLayout
- The value-channel contract: Controlled and uncontrolled