TabPanels
Content container that mirrors the tablist selection — orchestrates OrigamTabPanel children with optional fade transition and swipe support.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-tab-panels> — 3 layers. The root wraps an <OrigamDefaultsProvider> that forwards the transition prop to child panels. Only the active panel is shown; others are v-show-hidden.- 1.origam-tab-panels
- Root element. Manages the panel group via
useGroupand provides transition context viaORIGAM_TAB_PANELS_CTX_KEY. - 2OrigamDefaultsProvider (internal)
- Internal
<OrigamDefaultsProvider>that injects thetransitionprop into child<OrigamTabPanel>elements without requiring explicit prop drilling. - 3.origam-tab-panel--active
- The currently visible panel. Inactive panels remain in the DOM via
v-showafter first mount.
API
Props
All props accepted by this component, with their type, default value and description.
- tagstring'div'
- Root HTML element rendered for the panels container.
- transitionstring | false'fade'
- Transition name applied to <Transition> inside each OrigamTabPanel. Defaults to "fade". Pass false to disable all transitions.
- swipeablebooleanfalse
- Enables horizontal touch swipe to navigate panels (left → next, right → prev) via the v-touch directive.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- directionTDirection'horizontal'
- Layout direction. horizontal = panels stacked inline; vertical = flex-row with panels side by side.
- disabledboolean
- modelValueany
- Value of the currently visible panel. Bind with v-model — must stay in sync with the sibling OrigamTabs v-model.
- multipleboolean
- mandatorybooleantrue
- When true a panel is always visible (cannot deselect all).
- maxnumber
- selectedClassstring
API
Slots
Content slots exposed by this component.
- #default
- Container for OrigamTabPanel children. Receives group orchestration props for advanced custom panel rendering.
API
Emits
Events emitted by this component.
- @update:modelValueany
- Fired when the visible panel changes. Use v-model to bind.
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.
- () => void
- Programmatically selects the next panel in registration order.
- () => void
- Programmatically selects the previous panel in registration order.
- (value: any, selected: boolean) => void
- Programmatically selects a panel by its registered value.
- Ref<string>
- Reactive CSS string generated by useStyle.
- 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 inside the tab panels container.
- Horizontal padding applied inside the tab panels container.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | Action |
|---|---|
| Swipe left / right | When swipeable=true, horizontal swipe navigates to the next/previous panel. |
Notes
- OrigamTabPanels has no ARIA role of its own — it is a layout orchestrator. ARIA semantics live on each child OrigamTabPanel (role="tabpanel").
- Keep the v-model in sync with the sibling OrigamTabs v-model. Desynchronised models break the aria-controls / aria-labelledby wiring between tabs and panels.
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.
- dimensionvar(--origam-space---4)
- Default vertical padding for panel content.
- dimensionvar(--origam-space---0)
- Default horizontal padding for panel content.
- durationvar(--origam-motion__duration---fast)
- Duration of the fade transition between panels.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic panel container
Swipeable (touch)
Ecosystem
Family
Components from the same folder that share conventions and often compose together.