TabPanel

Navigation
stable

A single tab content panel — lazy-mounted by default until first activated, then kept alive via v-show.

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamTabPanelSchematic of the TabPanel component with 2 numbered internal parts. #default slot content 1 2 origam-tab-panel ① = role="tabpanel" · tabindex=0 · aria-labelledby; ② = lazy #default slot
Anatomy of <origam-tab-panel> — 2 parts. The root carries role="tabpanel" and aria-labelledby pointing to the sibling tab; the slot content is lazy-mounted on first activation.
1.origam-tab-panel
Root element. Carries role="tabpanel", tabindex="0" and aria-labelledby pointing to the matching tab id. Hidden via v-show when inactive.
2#default slot
Slot content area. Lazy-mounted on first activation via useLazy — renders only after the panel becomes selected for the first time.

API

Props

All props accepted by this component, with their type, default value and description.

tag
string
'div'
Root HTML element rendered for the panel container.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
value
any
Canonical identifier for this panel. Must match the value prop on the sibling OrigamTab.
disabled
boolean
false
Prevents this panel from being selected via the group.
selectedClass
string
'origam-tab-panel--active'
CSS class added to the panel root when it is the active selection.
eager
boolean
false
When true the slot content is mounted immediately (SSR / preload). When false (default) content is only mounted on first activation.

API

Slots

Content slots exposed by this component.

#default
Panel content. Lazy-mounted on first activation (unless eager=true). Kept alive via v-show after first mount.

API

Emits

Events emitted by this component.

@group:selected
{ value: boolean }

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to a child component.
Ref<string>
Reactive CSS string generated by useStyle from the computed panel styles.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet into the document.
() => void
Removes the injected style sheet.
Ref<boolean>
True once the style sheet has been injected into the DOM.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Vertical padding applied to each tab panel via the parent OrigamTabPanels.
Horizontal padding applied to each tab panel via the parent OrigamTabPanels.
Duration of the fade transition when switching panels.
Outline color shown on focus-visible for the panel container.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

tabpanel

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus into the panel content from the tablist.
Shift + TabReturns focus to the active tab in the tablist.

Notes

  • OrigamTabPanel sets role="tabpanel" and aria-labelledby pointing to the sibling tab DOM id automatically. No manual ARIA needed.
  • Content is not in the DOM until the panel is first activated (unless eager=true). Screen readers only perceive the content after it is mounted.
  • Inactive panels use v-show (not v-if) after first mount, so content remains in the DOM. Assistive technologies may still reach it via search — the v-show="false" (display: none) does hide it from AT per ARIA spec.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
duration
var(--origam-motion__duration---fast)
Duration of the fade transition when switching panels.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

This is an internal sub-part: it is injected by its parent component and cannot render on its own. See the parent component page for a live example.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Lazy panels

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.