fndn/ui

Components

Tabs

Beta

Switch between views that share one place.

Details

Switch between views that share one place. A row of 13px tab labels; the selected one sits on a filled pill (pill) or over an ink underline (underline), and that indicator slides to the next tab under the pointer and jumps under the keyboard. Panels swap instantly. One tab stop: arrow keys move and select. Tabs can be closable, which makes them document tabs (open files, browser tabs): a close button beside each trigger, Delete on the focused tab, focus and selection handed to a neighbour, a title cut at 240px, and a tab that opens or closes makes room instead of jumping. A strip with more tabs than room scrolls sideways, keeps the selected tab in view, fades each edge it continues past and shows a button at its end that lists every tab in a menu; `fill` makes the panel take the height of its container. Behaviour, focus and ARIA come from the Zag tabs machine, through Ark UI in React, Vue and Svelte.

Behaviour from Ark UI, the tabs machine of Zag.