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.
In Svelte this is NanaTabPanel, installed with the tabs. See Tab Group.
Preview
Section titled “Preview”<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> Installation
Section titled “Installation”npm install @nana-tec/ui-componentsImport
Section titled “Import”
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.
Basic usage
Section titled “Basic usage”<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
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
active | active | boolean | false | Whether the panel is currently shown (managed by the group). |
name | name | string | '' | The panel's name (matches a tab's panel). |
Slots
| Slot | Description |
|---|---|
(default) | The panel's content. |
CSS parts
| Part | Description |
|---|---|
::part(base) | The panel's host container. |
CSS custom properties
| Property | Description |
|---|---|
--nana-tab-panel-padding | Padding around the panel content. |