Table

Structured data display with rows and columns. Supports striped rows, avatars, checkboxes, sorting, sticky headers, grouped rows, and summary footers.

When To Use

  • Use Table when the user needs to enter or choose information as part of a larger form or workflow.
  • Start from this pattern when you need the interaction, spacing, and state treatment to match the rest of the system.
  • Use the examples below to choose the least complex control that still communicates the user’s next step clearly.

When Not To Use

  • Do not introduce a heavier or more customizable control when a simpler native-style field is sufficient.
  • Do not hide required context, validation, or option meaning behind placeholder text alone.

Accessibility Notes

  • Keep a visible label or an equivalent accessible name attached to the control.
  • Surface validation and helper text programmatically so assistive technologies receive the same context as sighted users.
  • Preserve the native focus order and keyboard interactions instead of replacing them with custom behavior.

Key Props / API

Key exports

Table, TableHeader, TableBody, TableFooter, TableRow, TableHead

Example Code

import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from "@hilum/ui"
import { Badge } from "@hilum/ui"

<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Voice</TableHead>
      <TableHead>Text</TableHead>
      <TableHead>Duration</TableHead>
      <TableHead>Status</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    {rows.map((row) => (
      <TableRow key={row.id}>
        <TableCell className="font-medium text-ground-900">{row.voice}</TableCell>
        <TableCell className="max-w-[200px] truncate text-ground-500">{row.text}</TableCell>
        <TableCell>{row.duration}</TableCell>
// ...trimmed for docs

Simple

Default

Header, body rows, and caption

Recent voice generations
VoiceTextDurationStatus
RogerThe quick brown fox jumps over the lazy dog.0:08Done
AriaWelcome to ElevenLabs, the leading AI voice platform.0:12Done
SarahGenerating expressive narration for chapter three...Processing
CharlieError: audio sample rate mismatch detected.Failed
MarcusVoice synthesis complete for the audiobook project.0:19Done

Striped rows

Alternating row backgrounds for easier scanning

VoiceTextDurationStatus
RogerThe quick brown fox jumps over the lazy dog.0:08Done
AriaWelcome to ElevenLabs, the leading AI voice platform.0:12Done
SarahGenerating expressive narration for chapter three...Processing
CharlieError: audio sample rate mismatch detected.Failed
MarcusVoice synthesis complete for the audiobook project.0:19Done

Condensed

Reduced row height for dense data

IDCompanyTypeAmountDateStatus
TXN-8821Acme CorpInvoice$4,200Apr 1, 2026Paid
TXN-8820Globex Inc.Invoice$1,900Mar 28, 2026Pending
TXN-8819Initech LLCRefund$320Mar 22, 2026Paid
TXN-8818Umbrella CorpInvoice$8,750Mar 15, 2026Overdue
TXN-8817Soylent CorpInvoice$2,100Mar 10, 2026Paid
TXN-8816Acme CorpCredit$500Mar 5, 2026Paid

With avatars

Avatars and multi-line content

User identity with stacked primary and secondary text

MemberRoleStatus
SP

Sarah Parker

s.parker@acme.com

Designer

Product

Active
GL

George Lin

g.lin@acme.com

Engineer

Engineering

Active
AP

Ana Portillo

a.portillo@acme.com

Product Manager

Product

On leave
LM

Lucas Meyer

l.meyer@acme.com

Engineer

Engineering

Active
EC

Emma Chen

e.chen@acme.com

Designer

Brand

Active

With checkboxes

Selectable rows

Select-all toggle, individual row selection, bulk action bar

NameRoleStatus
SP

Sarah Parker

s.parker@acme.com

DesignerActive
GL

George Lin

g.lin@acme.com

EngineerActive
AP

Ana Portillo

a.portillo@acme.com

Product ManagerOn leave
LM

Lucas Meyer

l.meyer@acme.com

EngineerActive
EC

Emma Chen

e.chen@acme.com

DesignerActive

Grouped rows

Grouped by status

Section headers span all columns to group related rows

CompanyTypeAmountDate
Paid
Acme CorpInvoice$4,200Apr 1, 2026
Initech LLCRefund$320Mar 22, 2026
Soylent CorpInvoice$2,100Mar 10, 2026
Acme CorpCredit$500Mar 5, 2026
Pending
Globex Inc.Invoice$1,900Mar 28, 2026
Overdue
Umbrella CorpInvoice$8,750Mar 15, 2026

Sortable headings

Column sorting

Click column headers to sort ascending or descending

TXN-8821Acme CorpApr 1, 2026$4,200Paid
TXN-8820Globex Inc.Mar 28, 2026$1,900Pending
TXN-8819Initech LLCMar 22, 2026$320Paid
TXN-8818Umbrella CorpMar 15, 2026$8,750Overdue
TXN-8817Soylent CorpMar 10, 2026$2,100Paid
TXN-8816Acme CorpMar 5, 2026$500Paid

Sticky header

VoiceTextDurationStatus
RogerThe quick brown fox jumps over the lazy dog.0:08Done
AriaWelcome to ElevenLabs, the leading AI voice platform.0:12Done
SarahGenerating expressive narration for chapter three...Processing
CharlieError: audio sample rate mismatch detected.Failed
MarcusVoice synthesis complete for the audiobook project.0:19Done
RogerThe quick brown fox jumps over the lazy dog.0:08Done
AriaWelcome to ElevenLabs, the leading AI voice platform.0:12Done
SarahGenerating expressive narration for chapter three...Processing
CharlieError: audio sample rate mismatch detected.Failed
MarcusVoice synthesis complete for the audiobook project.0:19Done

With summary rows

Invoice table

Footer rows for subtotals, tax, and totals using TableFooter

DescriptionHoursRateAmount
Design system audit12h$150/hr$1,800
Component library build40h$150/hr$6,000
Documentation & handoff8h$150/hr$1,200
Subtotal$9,000
Tax (20%)$1,800
Total$10,800