--- title: Table description: Display data clearly in rows and columns, helping users view, analyze, and compare information. Automatically renders as a list on small screens and a table on large ones. api_name: app-home source_url: html: https://shopify.dev/docs/api/app-home/polaris-web-components/structure/table md: https://shopify.dev/docs/api/app-home/polaris-web-components/structure/table.md --- # Table Display data clearly in rows and columns, helping users view, analyze, and compare information. Automatically renders as a list on small screens and a table on large ones. ## Properties * hasNextPage boolean Default: false Whether there's an additional page of data. * hasPreviousPage boolean Default: false Whether there's a previous page of data. * loading boolean Default: false Whether the table is in a loading state, such as initial page load or loading the next page in a paginated table. When true, the table could be in an inert state, which prevents user interaction. * paginate boolean Default: false Whether to use pagination controls. * variant "auto" | "list" Default: 'auto' Sets the layout of the Table. * `list`: The Table is always displayed as a list. * `table`: The Table is always displayed as a table. * `auto`: The Table is displayed as a table on wide devices and as a list on narrow devices. ## Slots * children HTMLElement The content of the Table. * filters HTMLElement Additional filters to display in the table. For example, the `s-search-field` component can be used to filter the table data. ## Events Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling). * nextpage CallbackEventListener\ | null * previouspage CallbackEventListener\ | null ### CallbackEventListener ```ts (EventListener & { (event: CallbackEvent): void; }) | null ``` ### CallbackEvent ```ts Event & { currentTarget: HTMLElementTagNameMap[T]; } ``` ## TableBody Define the main content area of a table, containing rows and cells that display data. ## Slots * children HTMLElement The body of the table. May not have any semantic meaning in the Table's `list` variant. ## TableCell Display data within a cell in a table row. ## Slots * children HTMLElement The content of the table cell. ## TableHeader Display column names at the top of a table. * format HeaderFormat The format of the column. Will automatically apply styling and alignment to cell content based on the value. * `base`: The base format for columns. * `currency`: Formats the column as currency. * `numeric`: Formats the column as a number. * listSlot ListSlotType Default: 'labeled' Content designation for the table's `list` variant. * `primary`: The most important content. Only one column can have this designation. * `secondary`: The secondary content. Only one column can have this designation. * `kicker`: Content that is displayed before primary and secondary content, but with less visual prominence. Only one column can have this designation. * `inline`: Content that is displayed inline. * `labeled`: Each column with this designation displays as a heading-content pair. ### HeaderFormat ```ts 'base' | 'numeric' | 'currency' ``` ### ListSlotType ```ts 'primary' | 'secondary' | 'kicker' | 'inline' | 'labeled' ``` ## Slots * children HTMLElement The heading of the column in the `table` variant, and the label of its data in `list` variant. ## TableHeaderRow Define a header row in a table, displaying column names and enabling sorting. ## Slots * children HTMLElement Contents of the table heading row; children should be `TableHeading` components. ## TableRow Display a row of data within the body of a table. * clickDelegate string The ID of an interactive element (e.g. `s-link`) in the row that will be the target of the click when the row is clicked. This is the primary action for the row; it should not be used for secondary actions. This is a click-only affordance, and does not introduce any keyboard or screen reader affordances. Which is why the target element must be in the table; so that keyboard and screen reader users can interact with it normally. ## Slots * children HTMLElement The content of a TableRow, which should be `TableCell` components. ### Examples * #### Code ##### jsx ```jsx Name Email Phone John Doe john.doe@example.com 123-456-7890 Jane Doe jane.doe@example.com 123-456-7890 Brandon Doe brandon.doe@example.com 123-456-7890 ``` ##### html ```html Name Email Phone John Doe john.doe@example.com 123-456-7890 Jane Doe jane.doe@example.com 123-456-7890 Brandon Doe brandon.doe@example.com 123-456-7890 ``` ## Examples Component examples ### Basic usage Basic Usage Tables are full-width by default to utilize all available space for displaying data. With Pagination Demonstrates a table with pagination controls, showing how to add previous and next page functionality to handle large datasets. With Loading State Showcases the table's loading state, which can be used to indicate that data is being fetched or processed. Full-width table with multiple columns A comprehensive example showing a full-width table with multiple columns. Tables automatically expand to fill their container width. Advanced Table with All List Slot Types A comprehensive example demonstrating different list slot types for various header and cell configurations, showing how to use kicker, primary, secondary, inline, and labeled slots. ### Examples * #### Basic Usage ##### Description Tables are full-width by default to utilize all available space for displaying data. ##### jsx ```jsx Product Status Inventory Price Water bottle Active 128 $24.99 T-shirt Low stock 15 $19.99 Cutting board Out of stock 0 $34.99 ``` ##### html ```html Product Status Inventory Price Water bottle Active 128 $24.99 T-shirt Low stock 15 $19.99 Cutting board Out of stock 0 $34.99 ``` * #### With Pagination ##### Description Demonstrates a table with pagination controls, showing how to add previous and next page functionality to handle large datasets. ##### jsx ```jsx Product Status Sales Product 1 Active 250 Product 2 Active 180 Product 3 Paused 95 ``` ##### html ```html Product Status Sales Product 1 Active 250 Product 2 Active 180 Product 3 Paused 95 ``` * #### With Loading State ##### Description Showcases the table's loading state, which can be used to indicate that data is being fetched or processed. ##### jsx ```jsx Product Status Inventory Loading... Loading... Loading... ``` ##### html ```html Product Status Inventory Loading... Loading... Loading... ``` * #### Full-width table with multiple columns ##### Description A comprehensive example showing a full-width table with multiple columns. Tables automatically expand to fill their container width. ##### jsx ```jsx Product SKU Status Inventory Price Last updated Water bottle WB-001 Active 128 $24.99 2 hours ago T-shirt TS-002 Low stock 15 $19.99 1 day ago Cutting board CB-003 Out of stock 0 $34.99 3 days ago Notebook set NB-004 Active 245 $12.99 5 hours ago Stainless steel straws SS-005 Active 89 $9.99 1 hour ago ``` ##### html ```html Product SKU Status Inventory Price Last updated Water bottle WB-001 Active 128 $24.99 2 hours ago T-shirt TS-002 Low stock 15 $19.99 1 day ago Cutting board CB-003 Out of stock 0 $34.99 3 days ago Notebook set NB-004 Active 245 $12.99 5 hours ago Stainless steel straws SS-005 Active 89 $9.99 1 hour ago ``` * #### Advanced Table with All List Slot Types ##### Description A comprehensive example demonstrating different list slot types for various header and cell configurations, showing how to use kicker, primary, secondary, inline, and labeled slots. ##### jsx ```jsx ID Customer Email Status Orders Total spent #1001 Sarah Johnson sarah@example.com Active 23 $1,245.50 #1002 Mike Chen mike@example.com Inactive 7 $432.75 #1003 Emma Davis emma@example.com Active 15 $892.25 ``` ##### html ```html ID Customer Email Status Orders Total spent #1001 Sarah Johnson sarah@example.com Active 23 $1,245.50 #1002 Mike Chen mike@example.com Inactive 7 $432.75 #1003 Emma Davis emma@example.com Active 15 $892.25 ``` ## Related [![](https://shopify.dev/images/icons/32/pickaxe-1.png)![](https://shopify.dev/images/icons/32/pickaxe-1-dark.png)](https://shopify.dev/docs/api/app-home/patterns/compositions/index-table) [CompositionIndex table](https://shopify.dev/docs/api/app-home/patterns/compositions/index-table)