TableCell
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
import { TableCell } from "@rebasepro/ui";| Prop | Type | Required | Description |
|---|---|---|---|
children |
React.ReactNode |
— | |
header |
boolean |
— | |
scope |
string |
— | |
className |
string |
— | |
style |
React.CSSProperties |
— | |
align |
"center" | "left" | "right" |
— | |
colspan |
number |
— | |
id |
string |
— |
Example
Section titled “Example”This is the example the design-system sync renders and verifies for this component.
import { Table, TableHeader, TableBody, TableRow, TableCell, Chip } from "@rebasepro/ui";
const COLLECTIONS = [ { id: "c1", name: "users", rows: "128,442", rls: true }, { id: "c2", name: "orders", rows: "54,910", rls: true }, { id: "c3", name: "audit_logs", rows: "2,004,331", rls: false }];
export function AlignedCells() { return ( <div className="overflow-x-auto w-full"> <Table className="w-full"> <TableHeader> <TableCell header align="left">Name</TableCell> <TableCell header align="center">RLS</TableCell> <TableCell header align="right">Rows</TableCell> </TableHeader> <TableBody> {COLLECTIONS.map(col => ( <TableRow key={col.id}> <TableCell align="left" className="font-mono text-xs font-medium">{col.name}</TableCell> <TableCell align="center"> <Chip size="small" colorScheme={col.rls ? "green" : "red"}> {col.rls ? "Enabled" : "Disabled"} </Chip> </TableCell> <TableCell align="right">{col.rows}</TableCell> </TableRow> ))} </TableBody> </Table> </div> );}