Tab

Navigation
stable

Single registered tab inside an OrigamTabs tablist — renders the label text and optional leading/trailing icons.

Aperçu

Rendu de l’aperçu en cours…

default

Rendu de l’aperçu en cours…

with icon

Rendu de l’aperçu en cours…

disabled

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamTabSchematic of the Tab component with 4 numbered internal parts. icon Label / #default slot append icon 1 2 3 4 5 origam-tab ② prepend · ③ label · ④ append — flex row; ⑤ indicator — abs bottom
Anatomy of <origam-tab> — 5 internal parts. The indicator (⑤) is absolute-positioned at the block-end and scales on activation.
1.origam-tab
Root element. Renders as <button> by default. Carries role="tab", aria-selected, aria-controls and managed tabindex.
2.origam-tab__prepend
Leading icon area. Rendered with v-if="icon". Wraps an <OrigamIcon>.
3.origam-tab__label
Label zone. Contains the default slot (falls back to the text prop).
4.origam-tab__append
Trailing icon area. Rendered with v-if="appendIcon".
5.origam-tab__indicator
Absolute underline indicator. Visible only when variant="underline". Scales from 0 → 1 on --active via CSS transform.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

tag
string
'button'
Root HTML element. Defaults to button for keyboard accessibility.
text
string
''
Label text rendered inside the tab. Can also be provided via the default slot.
variant
TTabVariant
Visual variant inherited from the parent OrigamTabs. Controls indicator and pill rendering.
icon
Leading icon displayed before the label text.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
value
any
Canonical identifier for this tab. Must match the value prop on the sibling OrigamTabPanel.
disabled
boolean
false
Disables the tab. Sets aria-disabled and tabindex=-1; prevents click activation.
selectedClass
string
'origam-tab--active'
CSS class added to the tab root when it is the active selection.
color
TColor
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight
letterSpacing
TLetterSpacing
appendAvatar
string
appendIcon
Trailing icon displayed after the label text.
prependAvatar
string
prependIcon
TIcon
prependAriaLabel
string
appendAriaLabel
string

API

Slots

Emplacements de contenu exposés par ce composant.

#default
Default slot for the tab label. Receives group-item context props for custom rendering.

API

Emits

Événements émis par ce composant.

@group:selected
{ value: boolean }

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
Toggles the selected state of this tab in the group.
(value: boolean) => void
Programmatically selects (true) or deselects (false) this tab.
Ref<string>
Reactive CSS string generated by useStyle from the computed tab 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.

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.

Tab label color in resting state.
Tab background in resting state.
Minimum tab height.
Horizontal padding of each tab.
Vertical padding of each tab.
Gap between icon and label.
Tab label font size.
Tab label font weight.
Tab label letter spacing.
Tab border radius. Set to radius.full for pills variant.
Transition duration for color, background-color, border-color and transform.
Tab label color when active.
Font weight applied to the active tab.
Color of the underline indicator bar (variant="underline").
Thickness of the underline indicator bar.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

tab

Interactions clavier

Interactions clavier
ToucheAction
Enter / SpaceActivates the tab (selects it in the group).
ArrowLeft / ArrowRightMoves focus to the previous / next tab in the tablist (roving tabindex managed by OrigamTabs).
TabMoves focus outside the tablist to the next focusable element (tabpanel).

Notes

  • OrigamTab wires role="tab", aria-selected, aria-controls (pointing to the matching panel id) and aria-disabled automatically — no manual ARIA needed on the consumer side.
  • When disabled=true the tab gets aria-disabled="true" and tabindex=-1; click events are swallowed via handleClick guard.
  • Focus-visible outline is applied via :focus-visible pseudo-class (2px solid currentColor, outline-offset: -2px). Never shown on mouse click.
  • The indicator transform transition should be disabled under prefers-reduced-motion: reduce via the consuming theme.

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.

Source
color
var(--origam-color__text---secondary)
Resting label color.
dimension
var(--origam-space---12)
Minimum tab height.
fontWeight
var(--origam-font__weight---medium)
Resting label font weight.
duration
var(--origam-motion__duration---fast)
Transition duration for color and background changes.
color
var(--origam-color__action--primary---bg)
Underline indicator color for variant="underline".
dimension
var(--origam-border__width---2)
Thickness of the underline indicator.

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 tabs

vue

Tabs with icons

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.