Black Friday · Save 40% on Intent UI Design licenses with code UI2026.

Table

Loading...

Installation

Add the component with the CLI.

npx shadcn@latest add @intentui/table

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Install the dependencies, then copy the component source into your project.

npm install react-aria-components @heroicons/react cn

Anatomy

import {
  Table,
  TableBody,
  TableCell,
  TableColumn,
  TableHeader,
  TableRow,
} from "@/components/ui/table"
<Table aria-label="Bands">
  <TableHeader>
    <TableColumn>#</TableColumn>
    <TableColumn isRowHeader>Name</TableColumn>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>1</TableCell>
      <TableCell>Nirvana</TableCell>
    </TableRow>
    <TableRow>
      <TableCell>2</TableCell>
      <TableCell>The Beatles</TableCell>
    </TableRow>
  </TableBody>
</Table>

Examples

Searchable

Use Autocomplete to filter table rows as users type.

This example is based on Devon Govett’s table filtering demo.

Loading...

Expandable rows

Use expandable rows to show additional details below a row.

Loading...

Bulk actions

Tables may require bulk actions for handling multiple entries at once.

Loading...

Drag and drop

Similar to GridList, tables can also support drag and drop functionality.

Loading...

Sorting

Tables can be made sortable. Activate sorting by clicking on a column header.

Loading...

Resizable

Tables can be made resizable. To enable resizing, set the allowResize prop to true. And to make a column resizable, set the isResizable prop to true on the column.

Loading...

Infinite scrolling

Load more items as users scroll with infinite scrolling.

Loading...

To create a clickable link within a table row, use the href prop.

<TableRow href='/collections/table-example'/>

For client-side routing, React Aria recommends using the onAction event to handle navigation programmatically instead of passing an href prop. This is because some collection items cannot be rendered as native elements due to HTML specification limitations.

Bleed

Use the bleed prop to make the table stretch to the edges of its container. This is especially useful in layouts like sidebars, where you want the table to align with the container's outer padding.

<Table bleed className="[--gutter:--spacing(6)] sm:[--gutter:--spacing(4)]" aria-label="..."/>

With card

When placing a table inside a card, use bleed and set --gutter to var(--card-spacing) to align the table with the card's padding.

<Table bleed className="[--gutter:var(--card-spacing)]" aria-label="Users" />
Loading...

See the full demo at Sidebar 15.

Component API

Table

Table extends the React Aria Components <Table> component.

allowResizeboolean
bleedboolean
Default: false
classNamestring
gridboolean
Default: false
stripedboolean
Default: false

TableBody

TableBody extends the React Aria Components <TableBody> component.

classNamestring

TableCell

TableCell extends the React Aria Components <Cell> component.

classNamestring

TableColumn

TableColumn extends the React Aria Components <Column> component.

classNamestring
isResizableboolean
Default: false

TableHeader

TableHeader extends the React Aria Components <TableHeader> component.

classNamestring

TableRow

TableRow extends the React Aria Components <Row> component.

classNamestring

See the React Aria for the full API reference.

Design