Your next page is taking shape...

Opening Your Next Page…

Loading the guide and preparing its examples for you to explore. The page will appear here automatically when it’s ready, so you can keep this view open without refreshing.

Made for Preact. Built to be yours.

Data & Comparison

Table

A responsive, modern table primitive for structured data with semantic markup. Help people compare information without losing labels, units or context. Build the empty and loading states alongside the populated example. Import it from @/components/kamod-ui/table.

Source · Design reference · API reference · Theming · Styles


Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Installation

Import Table primitives from @/components/kamod-ui/table.

Install PackagesTerminal
pnpm add @kamod-ch/ui

Copy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.

Usage

Use TableHeader/TableBody/TableFooter and align numeric data to the right for better scanability.

Import SetupTypeScript
import { Table } from "@kamod-ch/ui";

Choose a complete composition from the examples below; required child components and props vary by pattern.

Component Examples & Variants

Explore Table in Different Contexts, from the starting pattern to the compositions below. Begin with Invoice Table, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.

Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.

Invoice Table

Make Values Easy to Compare Across Rows. Structure invoice data with columns for status, payment method and amount. Right-align numeric amounts for comparison and keep their units consistent, allowing the table to function as a readable record list before adding interactive features.

Use semantic headers and stable row keys, and keep currency or unit information explicit rather than assuming the column's meaning from its numeric appearance.

src/components/TableExample.tsx20 lines
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@kamod-ch/ui";

export const Example = () => (
  <Table class="w-full max-w-2xl">
    <TableCaption>A list of your recent invoices.</TableCaption>
    <TableHeader>
      <TableRow>
        <TableHead class="w-[100px]">Invoice</TableHead>
        <TableHead>Status</TableHead>
        <TableHead>Method</TableHead>
        <TableHead class="text-right">Amount</TableHead>
      </TableRow>
    </TableHeader>
    <TableBody>
      <TableRow><TableCell class="font-medium">INV001</TableCell><TableCell>Paid</TableCell><TableCell>Credit Card</TableCell><TableCell class="text-right">$250.00</TableCell></TableRow>
      <TableRow><TableCell class="font-medium">INV002</TableCell><TableCell>Pending</TableCell><TableCell>PayPal</TableCell><TableCell class="text-right">$150.00</TableCell></TableRow>
      <TableRow><TableCell class="font-medium">INV003</TableCell><TableCell>Unpaid</TableCell><TableCell>Bank Transfer</TableCell><TableCell class="text-right">$350.00</TableCell></TableRow>
    </TableBody>
  </Table>
);

Table Actions

Keep Row Commands Attached to the Correct Record. Add a compact dropdown to each row when several operations apply to the same record. Give the trigger a meaningful name and keep the row identity available so users can tell which item the actions affect.

Use stable record identifiers in handlers and separate destructive commands clearly; sorting should never change which record an already-bound action targets.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width
API reference

Props and Data

Configure Table using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.

Props, slots and variants for this component.

API reference
Your API, from source

Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.

Component Props

Read each option with its owning component. The
marker identifies required fields verified in that declaration. A ? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.
@kamod-ch/ui/table3.0 KB min · 0.8 KB gzipSignals: none

Table

TableProps

Table documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableProps

Configure children for Table. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableProps

Configure class for Table. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

TableBody

TableBodyProps

TableBody documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableBodyProps

Configure children for TableBody. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableBodyProps

Configure class for TableBody. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

TableCaption

TableCaptionProps

TableCaption documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableCaptionProps

Configure children for TableCaption. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableCaptionProps

Configure class for TableCaption. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

TableCell

TableCellProps

TableCell documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableCellProps

Configure children for TableCell. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableCellProps

Configure class for TableCell. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
colSpan
numberTableCellProps

Configure colSpan for TableCell. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

TableFooter

TableFooterProps

TableFooter documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableFooterProps

Configure children for TableFooter. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableFooterProps

Configure class for TableFooter. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

TableHead

TableHeadProps

TableHead documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableHeadProps

Configure children for TableHead. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableHeadProps

Configure class for TableHead. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

TableHeader

TableHeaderProps

TableHeader documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableHeaderProps

Configure children for TableHeader. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableHeaderProps

Configure class for TableHeader. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

TableRow

TableRowProps

TableRow documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildTableRowProps

Configure children for TableRow. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>TableRowProps

Configure class for TableRow. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

Data Type Reference

Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.

Table Props

1 declared field
TableProps
Exported Source Declaration from Table.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableProps before adapting it.

TableBody Props

1 declared field
TableBodyProps
Exported Source Declaration from TableBody.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableBodyProps before adapting it.

TableCaption Props

1 declared field
TableCaptionProps
Exported Source Declaration from TableCaption.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableCaptionProps before adapting it.

TableCell Props

2 declared fields
TableCellProps
Exported Source Declaration from TableCell.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableCellProps before adapting it.

TableFooter Props

1 declared field
TableFooterProps
Exported Source Declaration from TableFooter.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableFooterProps before adapting it.

TableHead Props

1 declared field
TableHeadProps
Exported Source Declaration from TableHead.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableHeadProps before adapting it.

TableHeader Props

1 declared field
TableHeaderProps
Exported Source Declaration from TableHeader.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableHeaderProps before adapting it.

TableRow Props

1 declared field
TableRowProps
Exported Source Declaration from TableRow.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TableRowProps before adapting it.

Accessibility

Table preserves native table elements through its component parts. Header and cell relationships depend on the structure you provide. TableHead supplies a th element; set scope where needed instead of relying on its visual header styling alone.

Take the Next Useful Step

You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.

Connect the Foundation

Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.

Build the Surrounding Screen

Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.

Make the Result Hold Up

Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.

Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.