Table
Responsive semantic table with hoverable and selectable rows.
| Export | Kind | Size |
|---|---|---|
| styles.css | Atomic CSS | 34.1 kB |
| tokens.stylex | VarGroup | 1.9 kB |
| themes.stylex | Light / Dark | 3.6 kB |
Usage
import {
table,
tableBody,
tableCell,
tableContainer,
tableHead,
tableHeader,
tableRow,
} from "coatx/table";
export const SimpleTable = () => (
<div {...tableContainer()}>
<table {...table()}>
<thead {...tableHeader()}>
<tr {...tableRow()}>
<th {...tableHead()}>Name</th>
</tr>
</thead>
<tbody {...tableBody()}>
<tr {...tableRow({ selected: true })}>
<td {...tableCell()}>coatx</td>
</tr>
</tbody>
</table>
</div>
);
Exports (coatx/table)
| Export | Description |
|---|---|
tableContainer(options?) |
Horizontally scrollable wrapper |
table(options?) |
Semantic <table> |
tableHeader(options?) |
<thead> section |
tableBody(options?) |
<tbody> section |
tableFooter(options?) |
<tfoot> summary section |
tableRow(options?) |
<tr> row with optional selected state |
tableHead(options?) |
<th> column header |
tableCell(options?) |
<td> data cell |
tableCaption(options?) |
<caption> element |
tableStyles |
Compiled StyleX style map |
Options
| Option | Type | Default |
|---|---|---|
selected |
boolean (row) |
false |