🎉 We are thrilled to introduce FastStore v2. If you are looking for documentation of the previous version of FastStore, please refer to FastStore v1.

UI Components
Molecules
Table

Table

Tables display information in a friendly way, allowing users to scan for details quickly.

The Table component is a compound of the following:

  • Table - renders a <div> as wrapper with a <table> tag inside it.
  • TableBody - renders a <tbody> tag.
  • TableHead - renders a <thead> tag.
  • TableRow - renders a <tr> tag.
  • TableFooter - renders a <tfoot> tag.
  • TableCell - renders a <th> or <td> tag depending on the value of the variant prop.

Overview


Import

Import the component from @faststore/ui

import { Table } from '@faststore/ui'

Import Styles

import '@faststore/ui/src/components/molecules/Table/styles.scss'

Usage


Props

All table-related components support all attributes also supported by their respective HTML tags. Besides those attributes, the following props are also supported:

Table

NameTypeDescriptionDefault
Coming Soon

TableBody

NameTypeDescriptionDefault
Coming Soon

TableRow

NameTypeDescriptionDefault
Coming Soon

TableFooter

NameTypeDescriptionDefault
Coming Soon

TableCell

NameTypeDescriptionDefault
Coming Soon

Design Tokens

Nested Elements

Head

Local tokenDefault value/Global token linked
--fs-table-head-weightvar(--fs-text-weight-bold)
--fs-table-head-bkg-colornone
--fs-table-head-padding-yvar(--fs-spacing-2)

Cell

Local tokenDefault value/Global token linked
--fs-table-cell-padding-xvar(--fs-spacing-3)
--fs-table-cell-padding-yvar(--fs-spacing-1)

Variants

With Footer

Local tokenDefault value/Global token linked
--fs-table-footer-weightvar(--fs-table-head-weight)
--fs-table-footer-bkg-colornone

Colored

Local tokenDefault value/Global token linked
--fs-table-colored-bkg-color
var(--fs-color-neutral-1)
--fs-table-colored-border-radiusvar(--fs-border-radius)

Bordered

Local tokenDefault value/Global token linked
--fs-table-bordered-border-widthvar(--fs-border-width)
- --fs-table-bordered-border-color
var(--fs-border-color-light)

Horizontal Scroll


Customization

data-fs-table

data-fs-table-content

data-fs-table-head

data-fs-table-row

data-fs-table-footer

data-fs-table-body

data-fs-table-cell="head | data"

data-fs-table-variant="colored | bordered"