Table

The root of the table family. Renders a <table> with collapsed borders and full width, and broadcasts cell config (size, cellPadding, hasStickyHeader) to descendant TableCells via TableContext.

import { Table, TableHead, TableBody, TableRow, TableCell } from '@soroush.tech/design-system/Table'

;<Table size="sm" hasStickyHeader>
  <TableHead>...</TableHead>
  <TableBody>...</TableBody>
</Table>

Examples

Default

RegionStatus
webfra1healthy42
apifra1healthy87
workeriad1degraded213
croniad1healthy55
edgesin1healthy12
db-proxyfra1healthy31
queuesfo1degraded158
authfra1healthy64
cdnglobalhealthy8
searchiad1healthy96
mailersfo1healthy120
metricssin1degraded176
const args: Partial<TableProps> = {}

<DeploymentsTable {...args} />

Composed

RegionStatus
webfra1healthy42
apifra1healthy87
workeriad1degraded213
croniad1healthy55
edgesin1healthy12
db-proxyfra1healthy31
queuesfo1degraded158
authfra1healthy64
cdnglobalhealthy8
searchiad1healthy96
mailersfo1healthy120
metricssin1degraded176
Total services12
const args: Partial<TableProps> = {}

<TableContainer maxHeight="320px" borderColor="light" borderWidth="thin" borderStyle="solid">
  <DeploymentsTable hasStickyHeader {...args}>
    <TableFooter>
      <TableRow>
        <TableCell colSpan={3}>Total services</TableCell>
        <TableCell align="right">{deployments.length}</TableCell>
      </TableRow>
    </TableFooter>
  </DeploymentsTable>
</TableContainer>

Dense

RegionStatus
webfra1healthy42
apifra1healthy87
workeriad1degraded213
croniad1healthy55
edgesin1healthy12
db-proxyfra1healthy31
queuesfo1degraded158
authfra1healthy64
cdnglobalhealthy8
searchiad1healthy96
mailersfo1healthy120
metricssin1degraded176
<DeploymentsTable size="sm" bg="paper" />

Row Selection

RegionStatus
webfra1healthy42
apifra1healthy87
workeriad1degraded213
croniad1healthy55
edgesin1healthy12
0 of 12 selected
Rows per page:
1-5 of 12
<SelectableTable />

Table API reference