TIS Design System

Table

Organiza dados relacionais para leitura e comparação por coluna, com semântica HTML nativa e comportamento controlado pela aplicação. Organizes relational data for reading and comparison by column, with native HTML semantics and application-controlled behavior.

Quando usarWhen to use

Use Table quandoUse Table when
Os dados têm colunas estáveis, rótulos claros e precisam ser comparados entre linhas. Data has stable columns, clear labels, and needs to be compared across rows.
Não use Table quandoDo not use Table when
O conteúdo é uma lista simples, uma grade de layout ou uma planilha editável com navegação de grid. Content is a simple list, a layout grid, or an editable spreadsheet requiring grid navigation.

ExemploExample

Clientes
Status E-mail Ações
Ana Silva
Ativo ana.silva@tis.com.br
Bruno Lima
Pendente bruno.lima@tis.com.br
<div class="ds-table-region" role="region" aria-label="Tabela de clientes" tabindex="0">
  <table class="ds-table ds-table--md">
    <caption class="ds-table__caption">Clientes</caption>
    <thead class="ds-table__header">
      <tr>
        <th class="ds-table__header-cell" scope="col">Cliente</th>
      </tr>
    </thead>
    <tbody class="ds-table__body">
      <tr class="ds-table__row">
        <td class="ds-table__cell">Ana Silva</td>
      </tr>
    </tbody>
  </table>
</div>

API públicaPublic API

Component / partContratoContract
Tableds-table; ds-table--md, ds-table--fixed, ds-table--nowrap.
Table/Header Rowthead.ds-table__header.
Table/Header Cellth.ds-table__header-cell; sortable e alinhamento end são modifiers.
Table/Rowtr.ds-table__row; states Default, Hover e Selected.
Table/Celltd.ds-table__cell; conteúdo, controles, alinhamento e truncate são composição.

Tamanhos e estadosSizes and states

SizeRow heightModifier
Small40PadrãoDefault
Medium48ds-table--md
Row stateContratoContract
Defaultds-table__row
Hover:hover; ds-table__row--hover apenas para demonstração estática.
Selectedds-table__row--selected ou data-selected="true"; Checkbox comunica a seleção sem transformar a table em grid.

Semântica e comportamentoSemantics and behavior

Mapeamento de tokensToken mapping

PartePartComponent tokensCSS
Table / Header / Rowcomponent.table.{container|header|row}.*--ds-table-container-*, --ds-table-header-*, --ds-table-row-*
Cellcomponent.table.cell.{padding-x|padding-y|gap}--ds-table-cell-*
Body / Captioncomponent.table.{body|caption}.*--ds-table-body-*, --ds-table-caption-*
Divider / Sortcomponent.table.{divider|sort}.*--ds-table-divider-*, --ds-table-sort-*
Focus Ringcomponent.focus-ring.*--ds-focus-ring-*

Accessibility

WCAGImplementaçãoImplementationStatus
1.3.1 Info and Relationshipstable, caption, thead, tbody, th scope="col", tr e td nativos.
2.1.1 KeyboardA região de overflow, sort, Checkbox e ações são operáveis por teclado.The overflow region, sort, Checkbox, and actions are keyboard operable.
2.4.11 Focus Not ObscuredSort e região usam Focus Ring dedicado sem recorte pelas cells.Sort and region use a dedicated Focus Ring without cell clipping.
4.1.2 Name, Role, Valuearia-sort fica no header ativo; Checkbox e Buttons têm nomes acessíveis.

RelacionadosRelated