Appica UIUI 1.0.0

Table

A styled table for displaying rows of data.

Recent transactions
DateDescriptionAmount
Aug 30Salary+ $4,150.00
Aug 24Netflix- $20.00
Aug 17Electricity- $186.35

Usage

Table is a thin, styled layer over the native table elements — it keeps the real <table>, <thead>, <tbody>, <tr>, <th>, and <td> semantics and just adds the surface, spacing, rounded corners, and optional striping/hover. All parts live under @appica/ui-react/table:

  • Table — the <table> root. Owns size, borderStyle, and the stripedRows / stripedColumns / hoverableRows toggles.
  • TableHeader / TableBody<thead> / <tbody> wrappers. The header gets a tinted bar; the body holds the data rows.
  • TableRow — a <tr>. Mark one highlighted to call it out.
  • TableHead — a <th> header cell (start-aligned by default).
  • TableCell — a <td> data cell.
  • TableCaption — a <caption> that sits above or below the table via position.

The rounded corners are applied automatically to the right cells, so you don't manage them by hand. Per-cell alignment (e.g. right-aligned amounts) is just a text-end utility on the relevant TableHead/TableCell.

Examples

Default

Header, body, a caption, and a right-aligned amount column. The outer border, header bar, and corner rounding come for free.

Sizes

size scales the cell padding, corner radius, and text together — sm, md (default), or lg.

Striped

stripedRows tints alternating rows for easier horizontal scanning; stripedColumns does the same down the columns. Use whichever fits the data — or neither.

Hoverable rows

hoverableRows tints a row as the pointer passes over it — handy when each row is a target you'll click or act on.

Border styles

borderStyle switches the cell separators: solid (default), dashed, or none for a borderless, airy look.

Highlighted row

Mark a TableRow as highlighted to single it out — a selected row, the current plan, or a flagged entry. It keeps its background through striping and hover.

Rich content

Cells take any content, so compose them with other components — an Avatar and stacked text in one cell, a Badge for status in another — and pull the caption to the top with position="top".

Scrollable

For a long table, wrap it in a ScrollArea with a fixed height. Pin the header to the top of the viewport with [&>thead>tr>th]:sticky [&>thead>tr>th]:top-0 so the columns stay labelled while the rows scroll.

Horizontal scroll

When a table has more columns than will fit, wrap it in a horizontal ScrollArea and keep the cells from wrapping with whitespace-nowrap. The columns scroll sideways instead of cramping.

RTL

Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior follows the same direction.

Columns lay out from the right, the rounded corners mirror to the correct sides, and a text-end amount column moves to the left edge — all because the styling uses logical properties. For setup details and caveats, see the RTL guide.

أحدث المعاملات
التاريخالوصفالمبلغ
٣٠ أغسطسالراتب+ ٤٬١٥٠٫٠٠ $
٢٤ أغسطسنتفليكس- ٢٠٫٠٠ $
١٧ أغسطسالكهرباء- ١٨٦٫٣٥ $

API reference

Table and its parts are styled native table elements — they're not Base UI primitives. Each forwards ref and every remaining attribute to its underlying element, so standard table attributes (colSpan, scope, …) work as usual.

Table

The <table> root. Owns the surface, sizing, and row/column treatments.

TableCaption

A <caption> describing the table. Placed above or below.

TableRow

A <tr>. Use highlighted to call out a single row.

TableHeader, TableBody, TableHead, TableCell

Thin wrappers over <thead>, <tbody>, <th>, and <td>. They take their native attributes plus className (merged via tailwind-merge). TableHead is start-aligned by default — add text-end (or text-center) for other alignments.

Accessibility

  • The component renders real table semantics — <table>, <thead>, <tbody>, <tr>, <th>, <td> — so screen readers announce rows, columns, and headers natively.
  • Use TableHead for header cells, and add scope="col" (or scope="row" for a row header) when the relationship isn't obvious, so assistive tech maps each data cell to its header.
  • A TableCaption gives the table an accessible name; keep it even when it's visually subtle.
  • highlighted is a visual cue only — if the highlighted row carries meaning (e.g. "current plan"), convey that in text as well, not by color alone.
  • Row hover and the highlight are background-only changes that don't affect the reading order or content.

© 2026 Appica UI. A free component library, crafted by the Appica team.