Skip to content
Nana UI

Navigation

Tab Panel

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.

View .md Download

In Svelte this is NanaTabPanel, installed with the tabs. See Tab Group.

Tab This is a tab panel.
npm install @nana-tec/ui-components

Import the autoloader once, in your app's entry point. Every <nana-*> tag then works anywhere, and each component downloads only the first time a page uses it:

import "@nana-tec/ui-components/autoloader";
import "@nana-tec/ui-components/theme";

The second line gives every component the Nana look and the design tokens behind it. Leave it out to style the components entirely yourself.

Import a component directly when it must be ready at once: on screen at first paint, or when you call its methods straight away. The two mix freely:

import "@nana-tec/ui-components/tab-panel";

Copied in with npx @nana-tec/ui add tab-panel? Import your project's own @/lib/nana-ui/autoloader.js once instead; the CLI keeps it up to date.

<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
activeactivebooleanfalseWhether the panel is currently shown (managed by the group).
namenamestring''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.