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<table>
tag.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 thevariant
prop.
Importโ
import { Table } from '@faststore/ui'
Usageโ
Installments | Amount | Total |
---|---|---|
1x | $200.00 | $200.00 |
2x | $100.00 | $200.00 |
3x | $68.00 | $204.00 |
4x | $52.00 | $208.00 |
5x | $43.00 | $215.00 |
Installments | Amount | Total |
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โ
testId
string
ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
store-table
TableBodyโ
testId
string
ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
store-table-body
TableRowโ
testId
string
ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
store-table-row
TableFooterโ
testId
string
ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
store-table-footer
TableCellโ
testId
string
ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
store-table-cell
variant
TableCellVariant
Specify if this component should be rendered as a header (``) or as a data cell (``).
data
scope
"col" | "colgroup" | "row" | "rowgroup"
Defines the cells that the header element (``) relates to. @see
Customizationโ
data-store-table
data-table-head
data-store-table-row
data-table-footer
data-table-body
data-table-cell='head'
data-table-cell='data'