# Table (Lumen Halo): prompt.md (v1.0.0)

- id: `lumen-table` · version 1.0.0 · component · free
- category: Data
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add https://beautiful-ui.dev/r/lumen-table.json`
- npm dependencies: none
- registry dependencies: utils, https://beautiful-ui.dev/r/lumen-foundation.json
- docs: https://beautiful-ui.dev/components/lumen-table
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

Rows on hairlines, numbers in tabular mono, a soft glow under the row you're on and a lit cell on a selected row's edge. shadcn's Table, cut from Lumen glass.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/lumen/table.tsx`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `lumen-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `Table`, `TableHeader / TableBody / TableFooter`, `TableRow / TableHead / TableCell`, `TableCaption`, and every exported type.
- CSS: the install merges this item's rules (the registry `css` field) into your global stylesheet, in `@layer components`, and adds the lumen foundation (tokens, keyframes, motion levels) once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--lumen-*` custom properties (`--lumen-accent`, `--lumen-accent-text`, `--lumen-bad`, `--lumen-bad-text`, `--lumen-focus`, `--lumen-good`, `--lumen-good-text`, `--lumen-hairline`, `--lumen-ink`, `--lumen-muted-ink`, `--lumen-series-1`, `--lumen-series-2`, `--lumen-series-3`, `--lumen-series-4`, `--lumen-series-5`, `--lumen-series-6`, `--lumen-warn`, `--lumen-warn-text`); this item's CSS also reads `--lumen-font-mono`, `--lumen-font-sans`. Never add Tailwind colour classes inside the component.

```tsx
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/lumen/table";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `Table` | `table` | The table in its scroll container. |
| `TableHeader / TableBody / TableFooter` | `table-header` | Sections. |
| `TableRow / TableHead / TableCell` | `table-row` | Rows and cells. |
| `TableCaption` | `table-caption` | What it is. |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `GlassSoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/glass-sound.json`, import from `@/components/beautiful-ui/glass-sound`); `GlassSoundToggle` is its mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/lumen/table.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- table, data table, rows, grid, list of records, shadcn table, Lumen
- Records people compare: accounts, invoices, events

### Not when
- Sorting, paging and selection at scale: use Data Table

## Mistakes
- Right-align numbers in your cells

## Usage

```tsx
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/lumen/table";

<Table>
  <TableHeader><TableRow><TableHead>Account</TableHead><TableHead>MRR</TableHead></TableRow></TableHeader>
  <TableBody><TableRow><TableCell>Kitelabs</TableCell><TableCell>$4,200</TableCell></TableRow></TableBody>
</Table>
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `TableRow data-state` | `"selected"` |  | Lights the selected row. |

Full docs: https://beautiful-ui.dev/components/lumen-table

## Customising
- Colours: set the `--lumen-*` tokens on `:root`, or on a container with the `lumen-scope` class to retheme one area. Add the `lumen-inherit` class to follow your shadcn palette instead (`--chart-N`, `--destructive`).
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| — | Not focusable (its links and buttons are) |

## Motion inventory

| Interaction | What moves |
|---|---|
| Hover | A soft glow under the row |

## Accessibility contract (preserve when editing)
- A real <table> with header cells
- Give it a TableCaption

## Install

Base UI project (a base-* style in components.json):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/lumen-table.json
```

Radix project (a radix-*, new-york or default style):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/lumen-table.json
```

Or add the `@beautiful-ui` registry to components.json and run `npx shadcn@latest add @beautiful-ui/lumen-table`: the CLI picks the build from your style.

## Credits
- Built on shadcn/ui (https://ui.shadcn.com)

## Source (Base UI build)

### components/ui/lumen/table.tsx

```tsx
/**
 * Table (Lumen Halo) v1.0.0 · Beautiful UI
 * Docs: https://beautiful-ui.dev/components/lumen-table · Agent prompt: https://beautiful-ui.dev/md/lumen-table.md
 * Licensed to the purchaser under the Beautiful UI license: https://beautiful-ui.dev/license
 */
import type * as React from "react";
import { cn } from "@/lib/utils";

/*
 * Lumen Table. shadcn's Table in Lumen Halo: rows on hairlines, numbers in tabular mono, a soft glow
 * under the row you're on, and a lit cell at the edge of a selected row (data-state="selected").
 * Same exports and data-slots as shadcn; server-safe.
 */

function Table({ className, ...props }: React.ComponentProps<"table">) {
  return (
    <div data-slot="table-container" className={`lumen-table-container`}>
      <table data-slot="table" className={cn(`lumen-table`, className)} {...props} />
    </div>
  );
}

function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
  return <thead data-slot="table-header" className={cn(`lumen-table-header`, className)} {...props} />;
}

function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
  return <tbody data-slot="table-body" className={cn(`lumen-table-body`, className)} {...props} />;
}

function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
  return <tfoot data-slot="table-footer" className={cn(`lumen-table-footer`, className)} {...props} />;
}

function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
  return <tr data-slot="table-row" className={cn(`lumen-table-row`, className)} {...props} />;
}

function TableHead({ className, ...props }: React.ComponentProps<"th">) {
  return <th data-slot="table-head" className={cn(`lumen-table-head`, className)} {...props} />;
}

function TableCell({ className, ...props }: React.ComponentProps<"td">) {
  return <td data-slot="table-cell" className={cn(`lumen-table-cell`, className)} {...props} />;
}

function TableCaption({ className, ...props }: React.ComponentProps<"caption">) {
  return <caption data-slot="table-caption" className={cn(`lumen-table-caption`, className)} {...props} />;
}

export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
```

### CSS (the registry `css` / `cssVars`, merged into the global stylesheet by the shadcn CLI)

```css
@layer components {
  .lumen-table-container {
    position: relative;
    width: 100%;
    overflow-x: auto;
  }
  .lumen-table {
    width: 100%;
    border-collapse: collapse;
    caption-side: bottom;
    color: var(--gc-ink);
    font: 400 13.5px/1.45 var(--lumen-font-sans, var(--font-sans, var(--font-geist, var(--font-geist-sans, 'Geist')))), system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
  }
  .lumen-table-header .lumen-table-row {
    border-bottom: 1px solid var(--gc-hair);
  }
  .lumen-table-row {
    position: relative;
    border-bottom: 1px solid color-mix(in srgb,var(--gc-hair) 70%,transparent);
    transition: background min(0.2s, var(--gcp-cm)) ease;
  }
  .lumen-table-body .lumen-table-row:last-child {
    border-bottom: 0;
  }
  @media (hover:hover) {
    .lumen-table-body .lumen-table-row:hover {
      background: color-mix(in srgb,var(--gc-ink) 3.5%,transparent);
    }
  }
  .lumen-table-row[data-state="selected"] {
    background: color-mix(in srgb,var(--gc-acc) 8%,transparent);
  }
  .lumen-table-row[data-state="selected"]>:first-child {
    box-shadow: inset 2px 0 0 var(--gc-acc);
  }
  .lumen-table-head {
    height: 38px;
    padding: 0 12px;
    font: 500 10.5px/1.3 var(--lumen-font-mono, var(--font-mono, var(--font-geist-mono, 'Geist Mono'))), ui-monospace, monospace;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gc-sec);
    text-align: start;
    white-space: nowrap;
    vertical-align: middle;
  }
  .lumen-table-cell {
    padding: 10px 12px;
    white-space: nowrap;
    vertical-align: middle;
  }
  .lumen-table :is(.lumen-table-head,.lumen-table-cell):has([role="checkbox"]) {
    width: 1%;
    padding-inline-end: 0;
  }
  .lumen-table-footer {
    border-top: 1px solid var(--gc-hair);
    background: color-mix(in srgb,var(--gc-ink) 2.5%,transparent);
    font-weight: 500;
  }
  .lumen-table-caption {
    margin-top: 12px;
    font: 400 12.5px/1.4 var(--lumen-font-sans, var(--font-sans, var(--font-geist, var(--font-geist-sans, 'Geist')))), system-ui, sans-serif;
    color: var(--gc-sec);
  }
}
```

The lumen foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/lumen-foundation.json.
