Kaupvik KeelKaupvik Keel
Open Source · v0.1.0

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

PropertyTypeDefaultDescription
items{id,label}[]RequiredStable IDs and human labels.
selectedstringRequiredControlled active item.
onSelect(id)=>voidRequiredUpdate host state.
childrenReactNode—Current panel content.
labelstringViewsAccessible 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.