Fidely UI v1 beta is now available!. 🚀

Table

Used to display data in a tabular format.

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

Usage

import { Table } from '@fidely-ui/react'
<Table.Root>
  <Table.Header>
    <Table.Row>
      <Table.HeadCell />
    </Table.Row>
  </Table.Header>
  <Table.Body>
    <Table.Row>
      <Table.Cell />
    </Table.Row>
  </Table.Body>
</Table.Root>

Examples

Sizes

Use the size prop to adjust the spacing of table cells.

sm

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

md

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

lg

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

Hoverable

Use the hoverable prop to enable interractive hover effects on table rows, improving readability and focus.

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

Variants

Use the variant prop to change the visual style of the table (e.g., subtle, outline, striped).

subtle

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

outline

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

striped

ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Yoga MatFitness29.9929.99
Watercolor SetArt Supplies24.524.5
Running ShoesFootwear89.9989.99

With Caption

Use the Table.Caption component to add a caption to your table. You can also control its position with the captionSide prop ("top" or "bottom").

Item order and pricing information
ItemCategoryPriceStock
Organic HoneyGrocery12.9912.99
Organic HoneyGrocery12.9912.99
Organic HoneyGrocery12.9912.99

Scroll Area

Wrap your Table.Root with Table.ScrollArea to enable horizontal scrolling for wide tables and mobile screens.

ItemCategoryPriceStockExtra Column
Organic HoneyGrocery12.9912.99More info
Almond MilkGrocery3.493.49More info
Yoga MatFitness2525More info
Wireless MouseElectronics29.9929.99More info
Running ShoesFootwear79.9979.99More info

Props

Root

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Controls the spacing of table cells.
variant"subtle" | "outline" | "striped""subtle"Changes the visual style of the table.
hoverablebooleanfalseHighlights a row when hovered.
widthstring | number100%Sets the width of the table.
childrenReactNode—The content of the table.

HeadCell

PropTypeDefaultDescription
align"left" | "center" | "right""left"Aligns the header cell content.
widthstring | number—Sets a specific width for the header cell.
childrenReactNode—The content of the header cell.

Cell

PropTypeDefaultDescription
align"left" | "center" | "right""left"Aligns the cell content.
colSpannumber1Merges multiple columns into a single cell.
rowSpannumber1Merges multiple rows into a single cell.
childrenReactNode—The content of the cell.

Caption

PropTypeDefaultDescription
captionSide"top" | "bottom""bottom"Sets the position of the caption.
childrenReactNode—The caption text for the table.

ScrollArea

PropTypeDefaultDescription
childrenReactNode—The table content wrapped with a scroll container.
maxWidthstring | number"100%"Sets the maximum width of the scroll area.
maxHeightstring | number—Sets the maximum height of the scroll area, enabling vertical scroll.

On this page