TabPanels
Content container that mirrors the tablist selection — orchestrates OrigamTabPanel children with optional fade transition and swipe support.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #default
- Container for OrigamTabPanel children. Receives group orchestration props for advanced custom panel rendering.
API
Emits
Événements émis par ce composant.
- @update:modelValueany
- Fired when the visible panel changes. Use v-model to bind.
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- Vertical padding applied inside the tab panels container.
- Horizontal padding applied inside the tab panels container.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Interactions clavier
| Touche | 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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic panel container
Swipeable (touch)
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.