Design System

Tabs

Tabs de navegação horizontal para alternar entre seções de conteúdo. Apenas um painel e visível por vez.Horizontal navigation tabs for switching between content sections. Only one panel is visible at a time.

Quando usarWhen to use

Use tabs quandoUse tabs when
O conteúdo é organizado em categorias paralelas e o usuário precisa alternar entre elas sem navegar para outra página. Cada tab representa uma visão mutuamente exclusiva de conteúdo relacionado.Content is organized into parallel categories and the user needs to switch between them without page navigation. Each tab represents a mutually exclusive view of related content.
Não use tabs quandoDon't use tabs when
O conteúdo segue etapas sequenciais (use um stepper), a ação é navegar para páginas diferentes (use links de navegação), ou há mais de 6-7 categorias (considere outro padrão).Content follows sequential steps (use a stepper instead), the action is navigating to different pages (use nav links), or there are more than 6-7 categories (consider a different pattern).

AnatomiaAnatomy

1 2 3

Panel content goes here.

4
1 Lista de tabs (.ds-tabs) — container com role="tablist".Tab list (.ds-tabs) — container with role="tablist".
2 Tab (.ds-tab) — button individual com role="tab".Tab (.ds-tab) — individual tab button with role="tab".
3 Indicador ativo — borda inferior na tab ativa.Active indicator — bottom border on the active tab.
4 Painel da tab — área de conteúdo com role="tabpanel".Tab panel — content area with role="tabpanel".

Tabs padrãoDefault tabs

Uma tab fica ativa, as demais ficam no estado padrão. Cada tab controla um painel correspondente.One tab is active, the others are in their default state. Each tab controls a corresponding panel.

This is the Overview panel content. It provides a summary of your account status and recent activity.

Com tab desabilitadaWith disabled tab

Uma tab desabilitada não pode ser interagida e é ignorada durante a navegação por teclado.A disabled tab cannot be interacted with and is skipped during keyboard navigation.

General settings for your account: display name, language, and timezone preferences.

Múltiplas tabsMultiple tabs

As tabs rolam horizontalmente quando excedem o container.Tabs scroll horizontally when they overflow the container.

Dashboard panel showing project metrics, recent commits, and team activity overview.

Boas práticasBest practices

Faça
Use rotulos de 1-2 palavras. Mantenha a primeira tab ativa por padrão.Use 1-2 word labels. Keep the first tab active by default.
Não faça
Rotulos com frases completas. Iniciar sem nenhuma tab selecionada.Full sentence labels. Starting with no tab selected.

Diretrizes de conteúdoContent guidelines

RegraRuleExemploExample
Use substantivos como rotulosUse nouns as labels"Overview", "Settings", "Activity" — não "View overview" ou "Go to settings""Overview", "Settings", "Activity" — not "View overview" or "Go to settings"
Mesmo nível hierarquicoSame hierarchy levelTodas as tabs devem representar categorias paralelas do mesmo conteúdoAll tabs should represent parallel categories of the same content
Sem ícones sem textoNo icons without textSempre inclua um rotulo de texto — ícones sozinhos são ambíguos no contexto de tabsAlways include a text label — icons alone are ambiguous in tab context
Rotulos curtos (1-2 palavras)Keep labels short (1-2 words)"Pull Requests" — não "View all pull requests in this project""Pull Requests" — not "View all pull requests in this project"

Mapeamento de tokensToken mapping

PropriedadePropertyToken (semantic)Variavel CSSCSS variable
texto (inativo)text (inactive)semantic.content.secondary--ds-content-secondary
texto (ativo)text (active)semantic.primary.background.default--ds-primary-background-default
indicador ativoactive indicatorsemantic.primary.background.default--ds-primary-background-default
fundo (hover)background (hover)semantic.overlay.subtle--ds-overlay-subtle
focus ringsemantic.focus.ring.*--ds-focus-ring-width, --ds-focus-ring-offset, --ds-focus-ring-color

Classes CSSCSS classes

ClasseClassDescricaoDescription
ds-tabsContainer da lista de tabsTab list container
ds-tabButton individual de tabIndividual tab button
ds-tab--activeTab ativa / selecionadaActive / selected tab
disabled (atributo HTML)(HTML attribute)Tab desabilitada — usar o atributo nativo disabled; não existe classe ds-tab--disabledDisabled tab — use the native disabled attribute; there is no ds-tab--disabled class
ds-tab-panelÁrea de conteúdo do painelTab panel content area

Interação por tecladoKeyboard interaction

TeclaKeyAçãoAction
TabMove o foco para a lista de tabs, parando na tab ativaMoves focus into the tab list, landing on the active tab
Arrow Left / Arrow RightMove para a tab anterior / proxima (ativa automaticamente)Moves to previous / next tab (auto-activates)
HomeMove para a primeira tabMoves to the first tab
EndMove para a ultima tabMoves to the last tab
Tab (da lista)(from list)Move o foco para o conteúdo do painel ativoMoves focus into the active panel content

Tabs desabilitadas são ignoradas na navegação por setas. Apenas a tab ativa está na sequência Tab (tabindex="0"); todas as outras tem tabindex="-1".Disabled tabs are skipped during arrow key navigation. Only the active tab is in the Tab sequence (tabindex="0"); all others have tabindex="-1".

AccessibilityAccessibility

Criterio WCAGWCAG criterionRequisitoRequirementStatus
4.1.2 Name, Role, Value (A)role="tablist", role="tab", role="tabpanel". aria-selected nas tabs. aria-controls / aria-labelledby vinculando tabs a paineis.role="tablist", role="tab", role="tabpanel". aria-selected on tabs. aria-controls / aria-labelledby linking tabs to panels.
2.1.1 Keyboard (A)Setas navegam entre tabs. Tab entra e sai da lista de tabs.Arrow keys navigate between tabs. Tab enters and exits the tab list.
2.4.11 Focus Appearance (AA)Focus ring visível na tab ativa quando focada.Focus ring visible on the active tab when focused.
Resumo dos atributos ARIAARIA attributes summary
role="tablist" — no container da lista de tabs.
role="tab" — em cada button de tab.
role="tabpanel" — em cada painel de conteúdo.
aria-selected="true|false" — indica a tab ativa.
aria-controls — em cada tab, apontando para o ID do painel correspondente.
aria-labelledby — em cada painel, apontando para o ID da tab correspondente.
aria-disabled="true" — em tabs desabilitadas.
role="tablist" — on the tab list container.
role="tab" — on each tab button.
role="tabpanel" — on each content panel.
aria-selected="true|false" — indicates the active tab.
aria-controls — on each tab, pointing to the corresponding panel ID.
aria-labelledby — on each panel, pointing to the corresponding tab ID.
aria-disabled="true" — on disabled tabs.

RelacionadosRelated