Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Data

Table <pm-table>

Basic table: columns and rows in, an accessible table out.

Full screen
No archived plans. Plans you retire are listed here.

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/icon'; import '@prismora/elements/table'; import { registerIcons } from '@prismora/elements/icon'; import { archive } from '@prismora/icons'; registerIcons([archive]); </script> <pm-table label="Plans" striped columns='[{"key": "plan", "label": "Plan", "sortable": true}, {"key": "seats", "label": "Seats", "type": "number", "sortable": true}, {"key": "price", "label": "Price / month", "type": "currency", "sortable": true}, {"key": "renews", "label": "Renews", "type": "date"}]' rows='[{"plan": "Starter", "seats": 3, "price": 0, "renews": "2027-01-15"}, {"plan": "Team", "seats": 25, "price": 240, "renews": "2026-12-31"}, {"plan": "Business", "seats": 120, "price": 1450, "renews": "2027-03-01"}, {"plan": "Enterprise", "seats": 900, "price": 9800, "renews": "2027-06-30"}]'></pm-table> <pm-table label="Archived plans" columns='[{"key": "plan", "label": "Plan"}, {"key": "seats", "label": "Seats", "type": "number"}, {"key": "price", "label": "Price / month", "type": "currency"}]' rows='[]'> <span slot="empty" class="pm-cluster" style="justify-content: center"> <pm-icon name="archive"></pm-icon> No archived plans. Plans you retire are listed here. </span> </pm-table>

States

Each state is one attribute.

Loading

Overview

Sortable columns (natural, locale-aware), Intl formatting by column type, sticky header, striped/hover rows, loading skeleton, empty state, and labelled cards in narrow containers. About a third the size of <pm-data-table>; use that for search, filters, selection, paging, pinned/resizable columns, grouping and editing. For zero JS, style a plain <table class="pm-table">.

Cell content, first match wins: render(row) (text, DOM node or Lit template) → a light-DOM <template data-cell="key"> with {{field}} placeholders (values are escaped; also {{value}}, {{text}}) → format(value, row) → Intl formatting by type (number, currency, percent, bytes, date, datetime, time, boolean) with formatOptions, prefix/suffix → the plain value (arrays joined, objects as JSON). Headers: renderHeader(col) → <template data-header="key"> → label (always the accessible name). cellClass, headerClass and wrap style columns.

Attributes

AttributeTypeDefaultDescription
columnsTableColumn<R>[][]Column definitions: key, label, type, sorting, formatting and rendering.
rowsR[][]Row objects (or a JSON string).
labelstring—Accessible name (caption).
sortSortState—Current sort: { key, direction }.
stripedbooleanfalseShade alternate rows.
loadingbooleanfalseShow a loading state (and mark the region busy for assistive tech).
empty-text
prop: emptyText
stringNo resultsText shown when there is nothing to list.
stack'auto' | 'never'—Narrow containers (< 36rem): auto shows rows as labelled cards; never keeps a scrolling table.
max-height
prop: maxHeight
string—Scroll inside the table past this height (header stays visible), e.g. "24rem".
localestring—BCP 47 locale for number/date formatting (default: the page's).
row-clickable
prop: rowClickable
booleanfalseRows are clickable and fire pm-row-click.
manualbooleanfalseRows are already sorted (server-side); just emit pm-sort.

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-sortonPmSortThe sort order changed. detail.direction is not set when the sort was removed.
pm-row-clickonPmRowClickA row was clicked (with row-clickable).

Slots

SlotDescription
emptyContent when there are no rows.

Used in templates

Team and rolesPricing plans