ink-ui

๐Ÿ“Š Table

Structured data grid with bold muted column headers and truncating values.

<Table> renders a structured data grid with bold, muted column headers. It supports optional fixed column widths and truncates long values cleanly with an ellipsis.

import { Table } from "@kud/ink-ui";
import type { Column } from "@kud/ink-ui";

๐Ÿ”ง Props

PropTypeDescription
dataT[]Array of row objects
columnsColumn<T>[]Column definitions (see below)

The table is generic over the row type T, so column keys are checked against your data shape.

Column<T> shape

FieldTypeDescription
keykeyof T & stringObject key to read for this column
headerstringColumn heading text
widthnumberOptional fixed character width

Missing or nullish cell values render as an empty string. Columns without a width size to their content; columns with a width are fixed and truncate overflow.

๐Ÿ’ก Examples

<Table
  columns={[
    { key: "name", header: "Name", width: 16 },
    { key: "status", header: "Status" },
  ]}
  data={[
    { name: "api", status: "ok" },
    { name: "db", status: "degraded" },
  ]}
/>

On this page