Table

Last updated Feb 13, 2026

Table displays data in a structured grid of rows and columns, allowing users to scan, compare, and take action on information. The table component and its subcomponents support sticky headers, sortable columns, and row selection through checkboxes.

Anatomy of a table
  1. Header row : the top row of column headers; can include sorting controls and a select-all checkbox.
  2. Table container : the main wrapper that manages scrolling, sticky headers, and layout.
  3. Checkbox (optional): used to select one or more rows or all rows in the header.
  4. Header cell : a column label that identifies the type of data in that column; may include a sort icon.
  5. Body row : a horizontal group of cells representing a single data record.
  6. Cell : a data value within a row and column intersection.
  7. Sticky header (optional): a header that remains visible while scrolling vertically for large datasets.

Props

PropTypeRequiredDefaultDescription
ref((instance: HTMLTableElement | null) => void) | RefObject<HTMLTableElement> | null | undefinedfalse--
sizeenumfalse--
isLoadingboolean | undefinedfalse--
themeanyfalse--
asundefinedfalse--
forwardedAsundefinedfalse--
  • To display tabular data for scanning, sorting, or comparison.
  • When information is best presented in a grid-like structure with consistent columns.
  • When users need to sort or select individual rows for further actions.
  • For basic data tables that don’t require built-in search, filtering, or bulk operations.
  • Use a list or Card for simpler data presentations or unstructured content.

Do

  • Keep column labels short and descriptive.
  • Use sorting where it provides value and maintain clear visual indicators.
  • Align numeric data to the right and text to the left for better readability.
  • Use sticky headers for long datasets to keep context visible.
  • Provide row selection only when users can take meaningful action on selected items.

Don't

  • Overload tables with too many columns or deeply nested data.
  • Use tables for content that’s not structured in consistent columns.
  • Mix action buttons and inline editing within the same table cell without clear hierarchy.
  • Add sorting on columns where the order doesn’t matter or creates confusion.
  • Use semantic HTML structure: <table>, <thead>, <tbody>, <th>, and <td>.
  • Include proper header associations using scope="col" or scope="row".
  • For sortable headers, use aria-sort to indicate sort direction (ascending, descending, or none).
  • For row selection:
    • Header checkbox should toggle all rows.
    • Each checkbox should have a label or aria-labelledby linking to the row’s key data.
  • Ensure tables support keyboard navigation.
  • Sticky headers must remain readable and accessible to screen readers while scrolling.
  • Use concise, descriptive column headers (sentence case).
  • Include units or data formats in column headers if necessary (e.g., “Amount (USD)”).
  • Keep cell content short and scannable; truncate long text with tooltips when needed.
  • Align related actions (e.g., “Edit”, “Delete”) consistently in a dedicated column.
  • If using a checkbox column, position it as the first column.
  • Use clear empty states when no data is available (e.g., “No records found”).
  • Avoid embedding long-form text or interactive components that disrupt table readability.