| Subject | From | Date |
|---|---|---|
| Kumo v1.0.0 released | Visal In | 5 seconds ago |
| New Job Offer | Cloudflare | 10 minutes ago |
| Daily Email Digest | Cloudflare | 1 hour ago |
import { LayerCard, Table } from "@photon-ai/kumo-solid";
export function TableBasicDemo() {
return (
<LayerCard className="p-0">
<Table>
<Table.Header>
<Table.Row>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{emailData.slice(0, 3).map((row) => (
<Table.Row>
<Table.Cell>{row.subject}</Table.Cell>
<Table.Cell>{row.from}</Table.Cell>
<Table.Cell>{row.date}</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}Installation
Barrel
import { Table } from "@photon-ai/kumo-solid";Granular
import { Table } from "@photon-ai/kumo-solid/components/table";Usage
import { Table, LayerCard } from "@photon-ai/kumo-solid";
export default function Example() {
return (
<LayerCard class="p-0">
<Table>
<Table.Header>
<Table.Row>
<Table.Head>Name</Table.Head>
<Table.Head>Email</Table.Head>
<Table.Head>Role</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>John Doe</Table.Cell>
<Table.Cell>john@example.com</Table.Cell>
<Table.Cell>Admin</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
</LayerCard>
);
}Examples
With Checkboxes
Add row selection with Table.CheckHead and Table.CheckCell. Both accept
onCheckedChange, which matches the underlying Checkbox component’s
signature and exposes optional event details as a second argument.
The older onValueChange prop still works but is deprecated — the lint
rule will flag it and it will be removed in a future major version. Migrate
by renaming the prop:
// Before (deprecated)
<Table.CheckCell onValueChange={(checked) => toggleRow(id)} />
// After
<Table.CheckCell onCheckedChange={(checked) => toggleRow(id)} />
// With event details
<Table.CheckCell
onCheckedChange={(checked, eventDetails) => {
toggleRow(id);
eventDetails?.event.stopPropagation();
}}
/>| Subject | From | Date | |
|---|---|---|---|
| Kumo v1.0.0 released | Visal In | 5 seconds ago | |
| New Job Offer | Cloudflare | 10 minutes ago | |
| Daily Email Digest | Cloudflare | 1 hour ago |
import { createSignal } from "solid-js";
import { LayerCard, Table } from "@photon-ai/kumo-solid";
export function TableWithCheckboxDemo() {
const rows = emailData.slice(0, 3);
const [selectedIds, setSelectedIds] = createSignal<Set<string>>(new Set());
const toggleRow = (id: string) => {
setSelectedIds((prev) => {
const next = new Set(prev);
if (next.has(id)) {
next.delete(id);
} else {
next.add(id);
}
return next;
});
};
const toggleAll = () => {
if (selectedIds().size === rows.length) {
setSelectedIds(new Set<string>());
} else {
setSelectedIds(new Set(rows.map((r) => r.id)));
}
};
return (
<LayerCard className="p-0">
<Table>
<Table.Header>
<Table.Row>
<Table.CheckHead
checked={selectedIds().size === rows.length}
indeterminate={
selectedIds().size > 0 && selectedIds().size < rows.length
}
onCheckedChange={toggleAll}
aria-label="Select all rows"
/>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{rows.map((row) => (
<Table.Row>
<Table.CheckCell
checked={selectedIds().has(row.id)}
onCheckedChange={() => toggleRow(row.id)}
aria-label={`Select ${row.subject}`}
/>
<Table.Cell>{row.subject}</Table.Cell>
<Table.Cell>{row.from}</Table.Cell>
<Table.Cell>{row.date}</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}Compact Header
Use variant="compact" on Table.Header for a more condensed header style.
| Subject | From | Date |
|---|---|---|
| Kumo v1.0.0 released | Visal In | 5 seconds ago |
| New Job Offer | Cloudflare | 10 minutes ago |
| Daily Email Digest | Cloudflare | 1 hour ago |
import { LayerCard, Table } from "@photon-ai/kumo-solid";
export function TableWithCompactHeaderDemo() {
return (
<LayerCard className="p-0">
<Table>
<Table.Header variant="compact">
<Table.Row>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{emailData.slice(0, 3).map((row) => (
<Table.Row>
<Table.Cell>{row.subject}</Table.Cell>
<Table.Cell>{row.from}</Table.Cell>
<Table.Cell>{row.date}</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}Selected Row
Use variant="selected" on Table.Row to highlight selected rows.
| Subject | From | Date | |
|---|---|---|---|
| Kumo v1.0.0 released | Visal In | 5 seconds ago | |
| New Job Offer | Cloudflare | 10 minutes ago | |
| Daily Email Digest | Cloudflare | 1 hour ago |
import { createSignal } from "solid-js";
import { LayerCard, Table } from "@photon-ai/kumo-solid";
export function TableSelectedRowDemo() {
const rows = emailData.slice(0, 3);
const [selectedIds, setSelectedIds] = createSignal<Set<string>>(
new Set(["2"]),
);
const toggleRow = (id: string) => {
setSelectedIds((prev) => {
const next = new Set(prev);
if (next.has(id)) {
next.delete(id);
} else {
next.add(id);
}
return next;
});
};
const toggleAll = () => {
if (selectedIds().size === rows.length) {
setSelectedIds(new Set<string>());
} else {
setSelectedIds(new Set(rows.map((r) => r.id)));
}
};
return (
<LayerCard className="p-0">
<Table>
<Table.Header>
<Table.Row>
<Table.CheckHead
checked={selectedIds().size === rows.length}
indeterminate={
selectedIds().size > 0 && selectedIds().size < rows.length
}
onCheckedChange={toggleAll}
aria-label="Select all rows"
/>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{rows.map((row) => (
<Table.Row
variant={selectedIds().has(row.id) ? "selected" : "default"}
>
<Table.CheckCell
checked={selectedIds().has(row.id)}
onCheckedChange={() => toggleRow(row.id)}
aria-label={`Select ${row.subject}`}
/>
<Table.Cell>{row.subject}</Table.Cell>
<Table.Cell>{row.from}</Table.Cell>
<Table.Cell>{row.date}</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}Fixed Layout with Column Sizes
For precise control over column widths, set layout="fixed" and use
colgroup with col elements.
| Subject | From | Date |
|---|---|---|
| Kumo v1.0.0 released | Visal In | 5 seconds ago |
| New Job Offer | Cloudflare | 10 minutes ago |
| Daily Email Digest | Cloudflare | 1 hour ago |
| GitLab - New Comment | Rob Knecht | 1 day ago |
| Out of Office | Johnnie Lappen | 3 days ago |
import { LayerCard, Table } from "@photon-ai/kumo-solid";
export function TableFixedLayoutDemo() {
return (
<LayerCard className="p-0">
<Table layout="fixed">
<colgroup>
<col />
<col class="w-[150px]" />
<col class="w-[150px]" />
</colgroup>
<Table.Header>
<Table.Row>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{emailData.map((row) => (
<Table.Row>
<Table.Cell>{row.subject}</Table.Cell>
<Table.Cell>{row.from}</Table.Cell>
<Table.Cell>{row.date}</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}Sticky Column
Pin a column to the left or right edge of the scroll container with
sticky="left" or sticky="right" on Table.Head and Table.Cell. The
component automatically adds an opaque background and gradient fade. Wrap the
table in an overflow-x-auto container.
| Subject | From | Date | Tags | Actions |
|---|---|---|---|---|
| Kumo v1.0.0 released | Visal In | 5 seconds ago | — | |
| New Job Offer | Cloudflare | 10 minutes ago | — | |
| Daily Email Digest | Cloudflare | 1 hour ago | promotion | |
| GitLab - New Comment | Rob Knecht | 1 day ago | — | |
| Out of Office | Johnnie Lappen | 3 days ago | — |
import { Badge, Button, DropdownMenu, LayerCard, Table } from "@photon-ai/kumo-solid";
import { DotsThree, Eye, PencilSimple, Trash } from "~/components/icons";
/**
* Demonstrates a sticky right-hand actions column that stays pinned while the
* table scrolls horizontally. Uses `sticky="right"` on `Table.Head` and
* `Table.Cell` — the gradient fade and opaque background are applied
* automatically.
*/
export function TableStickyColumnDemo() {
return (
<LayerCard className="w-full max-w-md overflow-x-auto p-0">
<Table>
<Table.Header>
<Table.Row>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
<Table.Head>Tags</Table.Head>
<Table.Head sticky="right">
<span class="sr-only">Actions</span>
</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{emailData.map((row) => (
<Table.Row>
<Table.Cell className="whitespace-nowrap">
{row.subject}
</Table.Cell>
<Table.Cell className="whitespace-nowrap">{row.from}</Table.Cell>
<Table.Cell className="whitespace-nowrap">{row.date}</Table.Cell>
<Table.Cell className="whitespace-nowrap">
{row.tags ? (
<div class="inline-flex gap-1">
{row.tags.map((tag) => (
<Badge>{tag}</Badge>
))}
</div>
) : (
"—"
)}
</Table.Cell>
<Table.Cell sticky="right" className="text-right">
<DropdownMenu>
<DropdownMenu.Trigger
render={(renderProps) => (
<Button
{...renderProps}
variant="ghost"
size="sm"
shape="square"
aria-label="More options"
>
<DotsThree weight="bold" size={16} />
</Button>
)}
/>
<DropdownMenu.Content>
<DropdownMenu.Item icon={Eye}>View</DropdownMenu.Item>
<DropdownMenu.Item icon={PencilSimple}>
Edit
</DropdownMenu.Item>
<DropdownMenu.Separator />
<DropdownMenu.Item icon={Trash} variant="danger">
Delete
</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu>
</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}Compact Header with Sticky Column
Combining variant="compact" on Table.Header with sticky columns.
| Subject | From | Date | Tags | Actions |
|---|---|---|---|---|
| Kumo v1.0.0 released | Visal In | 5 seconds ago | — | |
| New Job Offer | Cloudflare | 10 minutes ago | — | |
| Daily Email Digest | Cloudflare | 1 hour ago | promotion | |
| GitLab - New Comment | Rob Knecht | 1 day ago | — | |
| Out of Office | Johnnie Lappen | 3 days ago | — |
import { Badge, Button, DropdownMenu, LayerCard, Table } from "@photon-ai/kumo-solid";
import { DotsThree, Eye, PencilSimple, Trash } from "~/components/icons";
/**
* Demonstrates a compact header combined with sticky columns. This combination
* may exhibit visual inconsistencies between the compact header background
* (`bg-kumo-elevated`) and the sticky cell background (`bg-kumo-base`).
*/
export function TableCompactStickyDemo() {
return (
<LayerCard className="w-full max-w-md overflow-x-auto p-0">
<Table>
<Table.Header variant="compact">
<Table.Row>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
<Table.Head>Tags</Table.Head>
<Table.Head sticky="right">
<span class="sr-only">Actions</span>
</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{emailData.map((row) => (
<Table.Row>
<Table.Cell className="whitespace-nowrap">
{row.subject}
</Table.Cell>
<Table.Cell className="whitespace-nowrap">{row.from}</Table.Cell>
<Table.Cell className="whitespace-nowrap">{row.date}</Table.Cell>
<Table.Cell className="whitespace-nowrap">
{row.tags ? (
<div class="inline-flex gap-1">
{row.tags.map((tag) => (
<Badge>{tag}</Badge>
))}
</div>
) : (
"—"
)}
</Table.Cell>
<Table.Cell sticky="right" className="text-right">
<DropdownMenu>
<DropdownMenu.Trigger
render={(renderProps) => (
<Button
{...renderProps}
variant="ghost"
size="sm"
shape="square"
aria-label="More options"
>
<DotsThree weight="bold" size={16} />
</Button>
)}
/>
<DropdownMenu.Content>
<DropdownMenu.Item icon={Eye}>View</DropdownMenu.Item>
<DropdownMenu.Item icon={PencilSimple}>
Edit
</DropdownMenu.Item>
<DropdownMenu.Separator />
<DropdownMenu.Item icon={Trash} variant="danger">
Delete
</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu>
</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}Full Example
Complete table with checkboxes, badges, action buttons, and fixed column widths.
| Subject | From | Date | ||
|---|---|---|---|---|
Kumo v1.0.0 released | Visal In | 5 seconds ago | ||
New Job Offer | Cloudflare | 10 minutes ago | ||
Daily Email Digest promotion | Cloudflare | 1 hour ago | ||
GitLab - New Comment | Rob Knecht | 1 day ago | ||
Out of Office | Johnnie Lappen | 3 days ago |
import { createSignal } from "solid-js";
import { Badge, Button, DropdownMenu, LayerCard, Table } from "@photon-ai/kumo-solid";
import { DotsThree, EnvelopeSimple, Eye, PencilSimple, Trash } from "~/components/icons";
export function TableFullDemo() {
const [selectedIds, setSelectedIds] = createSignal<Set<string>>(
new Set(["2"]),
);
const toggleRow = (id: string) => {
setSelectedIds((prev) => {
const next = new Set(prev);
if (next.has(id)) {
next.delete(id);
} else {
next.add(id);
}
return next;
});
};
const toggleAll = () => {
if (selectedIds().size === emailData.length) {
setSelectedIds(new Set<string>());
} else {
setSelectedIds(new Set(emailData.map((r) => r.id)));
}
};
return (
<LayerCard className="w-full overflow-x-auto p-0">
<Table layout="fixed">
<colgroup>
<col />
{/* Checkbox column - width handled by Table.CheckHead/CheckCell */}
<col />
<col style={{ width: "150px" }} />
<col style={{ width: "120px" }} />
<col style={{ width: "50px" }} />
</colgroup>
<Table.Header>
<Table.Row>
<Table.CheckHead
checked={selectedIds().size === emailData.length}
indeterminate={
selectedIds().size > 0 && selectedIds().size < emailData.length
}
onCheckedChange={toggleAll}
aria-label="Select all rows"
/>
<Table.Head>Subject</Table.Head>
<Table.Head>From</Table.Head>
<Table.Head>Date</Table.Head>
<Table.Head></Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{emailData.map((row) => (
<Table.Row
variant={selectedIds().has(row.id) ? "selected" : "default"}
>
<Table.CheckCell
checked={selectedIds().has(row.id)}
onCheckedChange={() => toggleRow(row.id)}
aria-label={`Select ${row.subject}`}
/>
<Table.Cell>
<div class="flex items-center gap-2">
<EnvelopeSimple size={16} />
<span class="truncate">{row.subject}</span>
{row.tags && (
<div class="ml-2 inline-flex gap-1">
{row.tags.map((tag) => (
<Badge>{tag}</Badge>
))}
</div>
)}
</div>
</Table.Cell>
<Table.Cell>
<span class="truncate">{row.from}</span>
</Table.Cell>
<Table.Cell>
<span class="truncate">{row.date}</span>
</Table.Cell>
<Table.Cell className="text-right">
<DropdownMenu>
<DropdownMenu.Trigger
render={(renderProps) => (
<Button
{...renderProps}
variant="ghost"
size="sm"
shape="square"
aria-label="More options"
>
<DotsThree weight="bold" size={16} />
</Button>
)}
/>
<DropdownMenu.Content>
<DropdownMenu.Item icon={Eye}>View</DropdownMenu.Item>
<DropdownMenu.Item icon={PencilSimple}>
Edit
</DropdownMenu.Item>
<DropdownMenu.Separator />
<DropdownMenu.Item icon={Trash} variant="danger">
Delete
</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu>
</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</LayerCard>
);
}API Reference
Table
Root table component. Renders a semantic <table> element.
| Prop | Type | Default | Description |
|---|---|---|---|
| layout | "auto" | "fixed" | "auto" | - |
| variant | "default" | "selected" | "default" | - |
| sticky | "left" | "right" | - | - |
| className | string | - | Additional CSS classes |
| children | JSX.Element | - | Child elements |
Table.Header
Table header section. Renders <thead>. Set sticky to pin the header row to the top of the scroll container.
Table.Body
Table body section. Renders <tbody>.
Table.Row
Table row. Supports variant="selected" for highlighting.
| Prop | Type | Default |
|---|
No component-specific props. Accepts standard HTML attributes.
Table.Head
Header cell. Renders <th>. Accepts sticky="left" or sticky="right" to pin the column.
Table.Cell
Body cell. Renders <td>. Accepts sticky="left" or sticky="right" to pin the column.
Table.CheckHead
Header cell with checkbox for “select all” functionality.
| Prop | Type | Default |
|---|
No component-specific props. Accepts standard HTML attributes.
Table.CheckCell
Body cell with checkbox for row selection.
| Prop | Type | Default |
|---|
No component-specific props. Accepts standard HTML attributes.
Table.ResizeHandle
Draggable handle for column resizing. Use with TanStack Table or custom resize logic.
TanStack Table Integration
For advanced features like sorting, filtering, and resizable columns, integrate with TanStack Table. The Table component is designed to work seamlessly with TanStack’s headless API.
import {
createSolidTable,
flexRender,
getCoreRowModel,
} from "@tanstack/solid-table";
import { Table } from "@photon-ai/kumo-solid";
import { For } from "solid-js";
function DataTable(props) {
const table = createSolidTable({
get data() {
return props.data;
},
get columns() {
return props.columns;
},
getCoreRowModel: getCoreRowModel(),
columnResizeMode: "onChange",
});
return (
<Table layout="fixed">
<colgroup>
<For each={table.getAllColumns()}>
{(column) => <col style={{ width: `${column.getSize()}px` }} />}
</For>
</colgroup>
<Table.Header>
<For each={table.getHeaderGroups()}>
{(headerGroup) => (
<Table.Row>
<For each={headerGroup.headers}>
{(header) => (
<Table.Head>
{flexRender(
header.column.columnDef.header,
header.getContext(),
)}
<Table.ResizeHandle
onMouseDown={header.getResizeHandler()}
onTouchStart={header.getResizeHandler()}
/>
</Table.Head>
)}
</For>
</Table.Row>
)}
</For>
</Table.Header>
<Table.Body>
<For each={table.getRowModel().rows}>
{(row) => (
<Table.Row>
<For each={row.getVisibleCells()}>
{(cell) => (
<Table.Cell>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</Table.Cell>
)}
</For>
</Table.Row>
)}
</For>
</Table.Body>
</Table>
);
}Accessibility
Semantic HTML
Table uses semantic <table>, <thead>, <tbody>, <th>, and <td> elements for proper screen reader navigation.
Checkbox Labels
Always provide aria-label for Table.CheckHead and Table.CheckCell to
describe their purpose.
Keyboard Navigation
Tab moves focus through interactive elements. Checkboxes respond to Space.