Skip to Content
ComponentsTable

Table

Display tabular data using rows and columns.

Documentation

First Name
Last Name
Company
Address
FredJacksonAcme, Inc.123 Broad St.
SaraJamesAcme, Inc.123 Broad St.
RalphJeffersonXYZ, Inc.456 Main St.
NancyJensenXYZ, Inc.456 Main St.
import { Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow, } from "@optiaxiom/react"; import { data } from "./data"; export function App() { return ( <Table> <TableHeader> <TableRow> <TableHeaderCell>First Name</TableHeaderCell> <TableHeaderCell>Last Name</TableHeaderCell> <TableHeaderCell>Company</TableHeaderCell> <TableHeaderCell>Address</TableHeaderCell> </TableRow> </TableHeader> <TableBody> {data.map((row) => ( <TableRow key={row.id}> <TableCell>{row.firstName}</TableCell> <TableCell>{row.lastName}</TableCell> <TableCell>{row.company}</TableCell> <TableCell>{row.address}</TableCell> </TableRow> ))} </TableBody> </Table> ); }
import { Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow, } from "@optiaxiom/react/unstable"; export default () => ( <Table> <TableHeader> <TableRow> <TableHeaderCell /> </TableRow> </TableHeader> <TableBody> <TableRow> <TableCell> <TableAction /> </TableCell> </TableRow> </TableBody> </Table> );

Pagination

Display active page and navigate between multiple pages.

Props

Supports all Box props in addition to its own. Renders a <table> element.

Prop

asChild

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

false | true

className

string

layout

Use default table layout or grid for rows and cells.

"auto" | "fixed"

Default: auto

Supports all Box props in addition to its own. Renders a <thead> element.

Prop

asChild

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

false | true

className

string

pinned

Whether to pin the header cell to left/right of table.

false | true

Supports all Box props in addition to its own. Renders a <th> element.

Prop

asChild

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

false | true

className

string

pinned

Whether to pin the header cell to left/right of table.

false | true

Default: false

Supports all Box props in addition to its own. Renders a <tbody> element.

Prop

asChild

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

false | true

className

string

Supports all Box props in addition to its own. Renders a <tr> element.

Prop

asChild

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

false | true

className

string

Supports all Box props in addition to its own. Renders a <td> element.

Prop

asChild

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

false | true

className

string

pinned

Whether to pin the header cell to left/right of table.

false | true

Default: false

Supports all Box props in addition to its own. Renders a <div> element.

Prop

asChild

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

false | true

className

string

visible

Control whether to always show the contents or only when user is hovering or interacting with them.

"always" | "if-needed"

Changelog

  • Moved component out of Alpha.

    // Before import { Table } from "@optiaxiom/react/unstable"; // After import { Table } from "@optiaxiom/react";
  • Added component
Last updated on