| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Usage
import { Table } from "chakra-ui-solid";<Table.Root>
<Table.Caption />
<Table.Header>
<Table.Row>
<Table.ColumnHeader />
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell />
</Table.Row>
</Table.Body>
<Table.Footer>
<Table.Row>
<Table.Cell />
</Table.Row>
</Table.Footer>
</Table.Root>Examples
Sizes
Use the size prop to change the size of the table.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Variants
Use the variant prop to change the appearance of the table.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Striped
Use the striped prop to add zebra-stripes to the table.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Caption
Use the Table.Caption component to add a caption to the table.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Caption Top
Use the captionSide prop on Table.Caption to position the caption at the top of the table.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Column Border
Use the showColumnBorder prop to add borders between columns.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Overflow
Render the Table.ScrollArea component to enable horizontal scrolling.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Sticky Header
Use the stickyHeader prop to make the table header sticky.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Sticky Column
Here’s an example what uses data-sticky attributes to make table columns sticky during horizontal
scrolling.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Sticky Header and Column
Combine stickyHeader with data-sticky attributes to create a table with both a sticky header and
sticky columns. When using both features together, ensure the header row has a higher z-index to
keep sticky column headers visible.
| Product | Category | Price |
|---|---|---|
| Headphones | Electronics | 834.12 |
| Desk Chair | Furniture | 245.88 |
| Microwave | Home Appliances | 379.26 |
| Backpack | Accessories | 112.47 |
| Football | Sports | 95.14 |
| Smartphone | Electronics | 921.63 |
| Wrist Watch | Accessories | 418.52 |
| T-Shirt | Clothing | 35.29 |
| Vacuum Cleaner | Home Appliances | 601.22 |
| Lamp | Furniture | 157.88 |
| Drone | Electronics | 836.15 |
| Perfume | Beauty | 128.9 |
| Camping Tent | Outdoors | 458.4 |
Highlight on Hover
Use the interactive prop to highlight rows on hover.
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Column Group
Use the Table.ColumnGroup component to distribute the column widths using the html colgroup
element.
The only prop that works for this component is
htmlWidth
| Product | Category | Price |
|---|---|---|
| Laptop | Electronics | 999.99 |
| Coffee Maker | Home Appliances | 49.99 |
| Desk Chair | Furniture | 150 |
| Smartphone | Electronics | 799.99 |
| Headphones | Accessories | 199.99 |
Native Mode
There is no native prop here, where the React version has one for rendering <thead>, <tbody>,
<tr>, <td> and <th> directly inside Table.Root.
It works there by taking each slot’s resolved style object and re-hanging it on & thead,
& tr, & td — a composition that happens while the component renders. A slot here resolves to a
class name instead, and the rules behind it are generated by your Panda build long before anything
renders, so there is nothing to compose.
What the prop buys upstream is stated on their page as performance: “eliminating the runtime styling
and React Context overhead”. Neither cost is here to remove. Table.Row and Table.Cell compute no
styles at render time, and reading the Root’s class map costs one context read that never
invalidates. Write the part components.
Props
Root
| Prop | Default | Type |
|---|---|---|
interactive | — | ConditionalValue<boolean>Highlight a body row on hover, for a table whose rows are clickable. |
showColumnBorder | — | ConditionalValue<boolean>Draw a rule between columns as well as between rows. |
size | 'md' | ConditionalValue<'sm' | 'md' | 'lg' | PresetVariant<'table', 'size'>>The cell padding and the table's type scale. |
stickyHeader | — | ConditionalValue<boolean>Pin the header row while the body scrolls under it. It only does anything inside a {@link TableScrollArea} — that is the box with the scrollbar — and offsets from `--table-sticky-offset`. |
striped | — | ConditionalValue<boolean>Zebra-stripe the body: every odd row's cells take `bg.muted`. |
variant | 'line' | ConditionalValue<'line' | 'outline' | PresetVariant<'table', 'variant'>>`line` rules each row off; `outline` boxes the whole table and tints the header. |
Plus HTMLChakraProps<"table"> — the whole style-prop surface and the DOM attributes of the element it renders, several hundred names listed as their sources rather than expanded — and the three every component takes: as, render and unstyled.