Settings layout
Compose settings with anchored sections or controlled route navigation and native cards.
Interactive example
Loading Polaris web components…
Usage
<SettingsLayout sections={[{id:"connection",title:"Store connection",children:<ConnectionSettings/>}]} />Properties
| Property | Type | Default | Description |
|---|---|---|---|
| sections | {id,title,icon?,href?,children?}[] | Required | Stable IDs; href for route mode, children for anchor mode. |
| selected | string | Optional | Controlled route mode; renders only current page children. |
| onNavigate | (id,href)=>void | Optional | Host router callback; modifier-click preserves link behavior. |
| children | ReactNode | Optional | Current routed page with native cards. |
| collapseNavigationOnDrawer | boolean | false | Temporarily hide and inert navigation while a shared drawer is open; restore on close. |
Design & interaction
Use native sections and controls. Explain only settings the merchant can act on. Navigation stays sticky on desktop and becomes a horizontal list on small screens. For many settings use selected + href + host onNavigate; current cards are route-owned, never hidden duplicate forms.
Accessibility
Anchor links work without scripting. IntersectionObserver updates aria-current in anchor mode; route mode uses aria-current=page and preserves keyboard/modifier-click links.
Open-source source
Available in github.com/Kaupvik/kaupvik-polaris ↗. Host apps supply authentication, native persistence, and read-back state.