Skip to content
coatx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Table

Responsive semantic table with hoverable and selectable rows.

Click any row to toggle selection.
ExportKindSize
styles.cssAtomic CSS34.1 kB
tokens.stylexVarGroup1.9 kB
themes.stylexLight / Dark3.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

Was this page helpful?