--- title: Table description: A responsive table component. base: aria component: true links: doc: https://react-aria.adobe.com/Table api: https://react-aria.adobe.com/Table#api --- ## Installation Command Manual ```bash npx shadcn@latest add table ``` Install the following dependencies: ```bash npm install react-aria-components ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table" ``` ```tsx showLineNumbers Invoice Status Method Amount INV001 Paid Credit Card $250.00
A list of your recent invoices. ``` ## Composition Use the following composition to build a `Table`: ```text Table ├── TableCaption ├── TableHeader │ └── TableRow │ ├── TableHead │ ├── TableHead │ ├── TableHead │ └── TableHead ├── TableBody │ ├── TableRow │ │ ├── TableCell │ │ ├── TableCell │ │ ├── TableCell │ │ └── TableCell │ └── TableRow │ ├── TableCell │ ├── TableCell │ ├── TableCell │ └── TableCell └── TableFooter ``` ## Footer Use the `` component to add a footer to the table. ## Actions A table showing actions for each row using a `` component. ## Data Table You can use the `` component to build more complex data tables. Combine it with [@tanstack/react-table](https://tanstack.com/table/latest) to create tables with sorting, filtering and pagination. See the [Data Table](/docs/components/aria/data-table) documentation for more information. You can also see an example of a data table in the [Tasks](/examples/tasks) demo. ## RTL To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). ## API Reference See the [React Aria Table](https://react-aria.adobe.com/Table#api) documentation.