Collections

Table

A high-performance, customizable table component for efficiently displaying large datasets.

Basic

A table displays data in rows and columns, allowing navigation via directional keys. It can optionally support row selection and sorting.

Loading...

Installation

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.

This component comes packed with several components to enhance functionality and provide a seamless experience.

Manual installation

npm i react-aria-components @intentui/icons

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>

Searchable

In the latest React Aria release, tables can now be made searchable since Autocomplete supports all collection types, including Table. This allows users to filter table rows directly with their input.

This example comes from a tweet by Devon here.

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

Tables can handle large datasets efficiently with infinite scrolling. This allows for loading more data as the user scrolls down, improving performance and user experience.

Loading...

Href

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

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

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, you can use bleed and adjust the --spacing variable to align with the card’s padding, allowing the table to span the full width.

Loading...

See the full demo at Sidebar 15.

Unlock the full power of
Design Intent UI
Build modern web apps faster with 400+ blocks and polished templates crafted for professionals.
Explore