Skip to content
Nana UI

Tab Panel

View .md Download

A content panel controlled by a nana-tab inside a nana-tab-group. Following the WAI-ARIA tabs pattern, the panel is only made focusable (tabindex="0") when it contains no focusable content of its own, so keyboard users always have a way to reach the panel without an extra stop.

Tab This is a tab panel.
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/tab-panel";
<nana-tab-group style="width:100%">
<nana-tab slot="nav" panel="a">Tab</nana-tab>
<nana-tab-panel name="a">This is a tab panel.</nana-tab-panel>
</nana-tab-group>

Properties

PropertyAttributeTypeDefaultDescription
activebooleanfalseWhether the panel is currently shown (managed by the group).
namestring''The panel's name (matches a tab's `panel`).

Slots

SlotDescription
(default)The panel's content.

CSS parts

PartDescription
::part(base)The panel's host container.

CSS custom properties

PropertyDescription
--nana-tab-panel-paddingPadding around the panel content.
SlotDescription
(default)The panel’s content.
VariableDefaultDescription
--nana-tab-panel-paddingPadding around the panel content.
PartDescription
baseThe panel’s host container
Explore Tab Panel interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook