Source tabs
Switch related source or presentation modes with accessible tabs.
Interactive example
Loading Polaris web components…
Usage
<SourceTabs items={[{id:"search",label:"Search & filter"},{id:"file",label:"Upload file"}]} selected={source} onSelect={setSource}>{panel}</SourceTabs>Properties
| Property | Type | Default | Description |
|---|---|---|---|
| items | {id,label}[] | Required | Stable IDs and human labels. |
| selected | string | Required | Controlled active item. |
| onSelect | (id)=>void | Required | Update host state. |
| children | ReactNode | — | Current panel content. |
| label | string | Views | Accessible tab-list name. |
Design & interaction
Search/filter is the default customer source. Switching the tab must not silently discard an imported file or selected customers.
Accessibility
Left/right arrows, Home/End, roving tabIndex, aria-selected and linked tab/panel IDs.
Open-source source
Available in github.com/Kaupvik/kaupvik-polaris ↗. Host apps supply authentication, native persistence, and read-back state.