--- 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 Orders placed Phone John Smith john@example.com 23 123-456-7890 Jane Johnson jane@example.com 15 234-567-8901 Brandon Williams brandon@example.com 42 345-678-9012 ``` ##### html ```html Name Email Orders placed Phone John Smith john@example.com 23 123-456-7890 Jane Johnson jane@example.com 15 234-567-8901 Brandon Williams brandon@example.com 42 345-678-9012 ``` ## Examples Component examples ### Basic usage Basic Usage Tables expand to full width by default. With Pagination Add pagination controls for navigating large datasets. With Loading State Display a loading state while fetching data. Full-width table with multiple columns Display multiple columns in a full-width table. List Variant Display data using the list variant with specialized slot types. List is the default variant on mobile devices. ### Examples * #### Basic Usage ##### Description Tables expand to full width by default. ##### 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 Add pagination controls for navigating 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 Display a loading state while fetching data. ##### jsx ```jsx Product Status Inventory Water bottle Active 128 T-shirt Low stock 15 Cutting board Out of stock 0 Notebook set Active 245 ``` ##### html ```html Product Status Inventory Water bottle Active 128 T-shirt Low stock 15 Cutting board Out of stock 0 Notebook set Active 245 ``` * #### Full-width table with multiple columns ##### Description Display multiple columns in a full-width table. ##### 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 ``` * #### List Variant ##### Description Display data using the list variant with specialized slot types. List is the default variant on mobile devices. ##### 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 [Composition - Index table](https://shopify.dev/docs/api/app-home/patterns/compositions/index-table)