View Switching
View switching is how an Adwaita window shows one of several pages at a time. A switcher — a segmented bar, a strip of tabs, a compact toolbar control, or a swipeable pager — lets the user pick which page is visible, while the pages themselves live in a stack that shows exactly one child. The pattern adapts to window size: a wide desktop shows a full switcher, a narrow phone collapses it.
Every widget below is described independently of any one toolkit, then shown
three ways. Native GJS (real Libadwaita through
@girs/adw-1) is the primary
implementation; the Web (@gjsify/adwaita-web)
and NativeScript (@gjsify/adwaita-nativescript)
ports mirror it. The preview is the real Web component — no screenshot — so it
follows the light/dark toggle just like a native window would.
View Switcher
Section titled “View Switcher”A view switcher presents a set of pages as one segmented control, each button
carrying a page’s icon and label. It drives a paired view stack that shows a
single page at a time. Its policy controls the button layout: wide places
the icon and label side by side; narrow stacks the icon above the label so the
bar fits a slim window — an adaptive layout usually swaps between the two on a
breakpoint.
Tab View
Section titled “Tab View”A tab view is a dynamic tabbed container: a tab bar renders one chip per page — with a title and a close affordance — over a header-colored strip, and the selected chip is raised onto the view background. Unlike a view switcher, tabs are meant to be added, closed and reordered at runtime. The tab bar can auto-hide when only a single page remains, so a one-tab document looks chrome-free.
Inline View Switcher
Section titled “Inline View Switcher”An inline view switcher is a compact, toolbar-friendly variant of the view switcher, built from a linked toggle group. It drives the same kind of view stack, but its display mode lets each toggle show labels, icons, or both — so it fits into a header bar or a tight toolbar where a full switcher would be too wide.
Carousel
Section titled “Carousel”A carousel is a horizontally swipeable pager: pages sit side by side and the
user flicks, scrolls or clicks a page indicator to move between them — a
common onboarding or gallery pattern. Adwaita ships two indicator widgets that
bind to a carousel: dots (shown here) and lines; both track the fractional
scroll position and grow/brighten the marker nearest the current page. The
scroll wheel pages the carousel by default — pass allow-scroll-wheel="false"
to leave wheel events to the page — while long swipes, off by default, let one
flick skip several pages.
Related
Section titled “Related”- Navigation — pages, split views and the navigation stack the switchers sit above.
- Layout — the
Clampand boxes that size a switched view. - Adwaita Storybook — the same widgets in a live, interactive component browser.