SenUI Logo

Rows of data, calmly arranged.

SenTable is a typed, headless-feeling table — give it columns and data, customize cells with a render function, and it stays out of the way.

NameEmailStatus
Alice Johnsonalice@example.comActive
Bob Smithbob@example.comInactive
Carol Leecarol@example.comActive

Rice paddies — orderly rows that make the field readable.

Basic

Columns plus data — zebra striping is on by default for legibility over long lists.

NameEmailStatus
Alice Johnsonalice@example.comActive
Bob Smithbob@example.comInactive
Carol Leecarol@example.comActive

No zebra

Cleaner for short tables and dense numeric data.

NameEmailStatus
Alice Johnsonalice@example.comActive
Bob Smithbob@example.comInactive
Carol Leecarol@example.comActive

Clickable rows + custom render

Pass onRowClick and rows become focusable buttons. Use the render column option for badges, money, dates, or anything that is not just text.

OrderCustomerTotalStatus
#1042Aiko Tanaka¥12,800paid
#1041Marcus Lee¥4,200pending
#1040Helena Reyes¥9,600refunded
#1039Sora Yamamoto¥21,000paid

Typed columns

Column keys are constrained to keyof TData — typos surface at compile time, not at runtime.

Render escape hatch

Drop in any ReactNode per cell — badges, links, formatted dates — without forking the table.

Keyboard rows

When onRowClick is set, rows become focusable and respond to Enter and Space.

The column shape.

Columns are plain objects, typed against the row data. The render function is the only escape hatch you need.

interface SenTableColumn<TData> {
  key: keyof TData          // which row property to read
  header: string            // column heading
  align?: 'left' | 'center' | 'right'
  render?: (value, row) => ReactNode  // custom cell content
}

Drop-in usage

The full shape — typed columns, custom render, click handler.

import SenTable from 'sen-ui/SenTable'
import type { SenTableColumn } from 'sen-ui/SenTable'

type User = { id: number; name: string; email: string; isActive: boolean }

const columns: SenTableColumn<User>[] = [
  { key: 'name', header: 'Name', align: 'left' },
  { key: 'email', header: 'Email', align: 'left' },
  {
    key: 'isActive',
    header: 'Status',
    align: 'center',
    render: (value) => (value ? 'Active' : 'Inactive'),
  },
]

export function UsersTable({ data }: { data: User[] }) {
  return (
    <SenTable
      columns={columns}
      data={data}
      zebra
      onRowClick={(row) => console.log(row.id)}
    />
  )
}