Unlock faster development with Fidely UI Pro components Coming soon

Table

Used to display data in a tabular format.

ItemCategoryPriceStock
Organic HoneyGrocery12.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

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.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

md

ItemCategoryPriceStock
Organic HoneyGrocery12.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

lg

ItemCategoryPriceStock
Organic HoneyGrocery12.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

Hoverable

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

ItemCategoryPriceStock
Organic HoneyGrocery12.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

Variants

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

subtle

ItemCategoryPriceStock
Organic HoneyGrocery12.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

outline

ItemCategoryPriceStock
Organic HoneyGrocery12.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

striped

ItemCategoryPriceStock
Organic HoneyGrocery12.9950
Yoga MatFitness29.9920
Watercolor SetArt Supplies24.515
Running ShoesFootwear89.9930

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.9950
Organic HoneyGrocery12.9940
Organic HoneyGrocery12.9980

Scroll Area

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

ItemCategoryPriceStockExtra Column
Organic HoneyGrocery12.9950More info
Almond MilkGrocery3.4930More info
Yoga MatFitness2590More info
Wireless MouseElectronics29.9920More info
Running ShoesFootwear79.9915More info

Use the stickyHeader prop to make the table header sticky.

ItemCategoryPriceStockExtra Column
Organic HoneyGrocery12.9950More info
Almond MilkGrocery3.4930More info
Yoga MatFitness2590More info
Wireless MouseElectronics29.9920More info
Running ShoesFootwear79.9915More 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