Marketing sectionsIndexTableStacked
Searchastronomic.dev# IndexTableStacked
For awards, press mentions or open roles under a heading, one ruled row each.
Static: no JavaScript.
## Usage
```astro
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
```
## Examples
### Under a heading
The header above the table, the table the full width of the row. A mark after the heading counts the rows.
```astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "tier", label: "Tier" },
{ key: "parts", label: "Parts", align: "end" as const },
];
const rows = [
{ cells: { family: "Pricing", tier: "Pro", parts: "4" } },
{ cells: { family: "Faq", tier: "Pro", parts: "4" } },
{ cells: { family: "Bento", tier: "Pro", parts: "4" } },
{ cells: { family: "StoryRail", tier: "Pro", parts: "2" } },
];
---
<div class="mx-auto max-w-4xl px-6 py-16">
<IndexTableStacked heading="Pro families" mark="(4)" markLabel="4 families" columns={columns} rows={rows} />
</div>
```
### No heading
caption: the table's name, visually hidden, with no section around it. Put your own heading above it, or let the page's own heading lead into it.
```astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "tier", label: "Tier" },
{ key: "parts", label: "Parts", align: "end" as const },
];
const rows = [
{ cells: { family: "Hero", tier: "Free", parts: "4" } },
{ cells: { family: "Card", tier: "Free", parts: "4" } },
{ cells: { family: "Footer", tier: "Free", parts: "4" } },
];
---
<div class="mx-auto max-w-4xl px-6 py-16">
<IndexTableStacked caption="Free families and their parts" columns={columns} rows={rows} />
</div>
```
### Linked rows
href on each row: the first cell's text links to that family's page. The other cells are plain text.
```astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "group", label: "Group" },
{ key: "parts", label: "Parts", align: "end" as const },
];
const rows = [
{ cells: { family: "Steps", group: "Marketing sections", parts: "4" }, href: "/ui/sections/steps" },
{ cells: { family: "Stats", group: "Marketing sections", parts: "3" }, href: "/ui/sections/stats" },
{ cells: { family: "IndexList", group: "Marketing sections", parts: "3" }, href: "/ui/sections/indexlist" },
];
---
<div class="mx-auto max-w-4xl px-6 py-16">
<IndexTableStacked heading="Process and proof" columns={columns} rows={rows} />
</div>
```
### Long text
Long names and notes wrap inside their cells; the end column never does. On a phone the end column stays on the first line.
```astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "note", label: "What it is for" },
{ key: "since", label: "Since", align: "end" as const },
];
const rows = [
{ cells: { family: "Testimonials and the quotes they hold", note: "One strong quote large on the page, or several short ones side by side on cards.", since: "Oct 2026" } },
{ cells: { family: "ArticleHeader", note: "The topic, the date and reading time, the title, a byline and a photo at the top of a post.", since: "Oct 2026" } },
];
---
<div class="mx-auto max-w-2xl px-6 py-16">
<IndexTableStacked heading="Two families, in more words" columns={columns} rows={rows} />
</div>
```
## Props
### IndexTableStacked
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | The section heading, in the section role in display type. It names the section and the table. Without it there is no section and no header: a plain <div> holds only the table, named by caption. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>: exactly two asterisks around text with no space inside. Off by default, so the heading shows as typed. |
| `mark` | `string` | None | A short mark after the heading, such as "(12)", in small muted type, outside the heading. Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "12 awards": the mark is then hidden from screen readers and this is read in its place. |
| `text` | `string` | None | One or two sentences under the heading, in the lead role, muted. Shown only with a heading. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. |
| `caption` | `string` | None | The table's name when there is no heading, in a visually hidden <caption>. With a heading too, the caption names the table and the heading the section. One of heading or caption is required: without either the build stops. |
| `columns` | `IndexColumn[]` | None | Required. The columns, in order: { key, label, align? }. key picks each row's cell; label is the column header; align "end" sets a year or a count at the end, in figures of one width, on the first line of the row on a phone. An empty list stops the build. |
| `rows` | `IndexRow[]` | None | Required. The rows, in order: { cells, href? }. cells holds each row's text by column key; a column with no cell shows an empty one, and keys that are not columns are left out. With href the first cell's text is a link to that page. An empty list stops the build. |
| `class` | `string` | None | More classes for the root (the <section>, or the <div> without a heading), merged with cn(), so yours win on conflicts. The root is a named size container (inline-size containment): in a shrink-to-fit parent it collapses, so give it a width there. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. Shown only with a heading. |
Any other attribute goes on the <section>, or on the <div> without a heading.
## Accessibility
- It is a real <table> with explicit roles on the table, its rows, its column headers and its cells, so its meaning holds on a phone, where the rows are laid out as two lines.
- With a heading it is a region named by it: a <section> whose heading id is unique on the page, and the table is labeled by the heading. Without one, the table is named by its caption (visually hidden). One of the two is required.
- The header row is visually hidden on a phone, but a screen reader still reads each cell with its column header.
- With href, the first cell's text is the row's one link, named by that text, at least 44px tall on touch screens, with the kit's focus ring.
- A year or a count (align "end") sits at the end of its row in figures of one width.
IndexTableStacked
FreeFor awards, press mentions or open roles under a heading, one ruled row each.
- File
- IndexTableStacked.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 4
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Under a heading
The header above the table, the table the full width of the row. A mark after the heading counts the rows.
This preview did not load.
examples/indextablestacked/main.astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "tier", label: "Tier" },
{ key: "parts", label: "Parts", align: "end" as const },
];
const rows = [
{ cells: { family: "Pricing", tier: "Pro", parts: "4" } },
{ cells: { family: "Faq", tier: "Pro", parts: "4" } },
{ cells: { family: "Bento", tier: "Pro", parts: "4" } },
{ cells: { family: "StoryRail", tier: "Pro", parts: "2" } },
];
---
<div class="mx-auto max-w-4xl px-6 py-16">
<IndexTableStacked heading="Pro families" mark="(4)" markLabel="4 families" columns={columns} rows={rows} />
</div>No heading
caption: the table's name, visually hidden, with no section around it. Put your own heading above it, or let the page's own heading lead into it.
This preview did not load.
examples/indextablestacked/no-heading.astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "tier", label: "Tier" },
{ key: "parts", label: "Parts", align: "end" as const },
];
const rows = [
{ cells: { family: "Hero", tier: "Free", parts: "4" } },
{ cells: { family: "Card", tier: "Free", parts: "4" } },
{ cells: { family: "Footer", tier: "Free", parts: "4" } },
];
---
<div class="mx-auto max-w-4xl px-6 py-16">
<IndexTableStacked caption="Free families and their parts" columns={columns} rows={rows} />
</div>Linked rows
href on each row: the first cell's text links to that family's page. The other cells are plain text.
This preview did not load.
examples/indextablestacked/linked.astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "group", label: "Group" },
{ key: "parts", label: "Parts", align: "end" as const },
];
const rows = [
{ cells: { family: "Steps", group: "Marketing sections", parts: "4" }, href: "/ui/sections/steps" },
{ cells: { family: "Stats", group: "Marketing sections", parts: "3" }, href: "/ui/sections/stats" },
{ cells: { family: "IndexList", group: "Marketing sections", parts: "3" }, href: "/ui/sections/indexlist" },
];
---
<div class="mx-auto max-w-4xl px-6 py-16">
<IndexTableStacked heading="Process and proof" columns={columns} rows={rows} />
</div>Long text
Long names and notes wrap inside their cells; the end column never does. On a phone the end column stays on the first line.
This preview did not load.
examples/indextablestacked/long-text.astro
---
import IndexTableStacked from "@astronomic-dev/ui/components/IndexTableStacked.astro";
const columns = [
{ key: "family", label: "Family" },
{ key: "note", label: "What it is for" },
{ key: "since", label: "Since", align: "end" as const },
];
const rows = [
{ cells: { family: "Testimonials and the quotes they hold", note: "One strong quote large on the page, or several short ones side by side on cards.", since: "Oct 2026" } },
{ cells: { family: "ArticleHeader", note: "The topic, the date and reading time, the title, a byline and a photo at the top of a post.", since: "Oct 2026" } },
];
---
<div class="mx-auto max-w-2xl px-6 py-16">
<IndexTableStacked heading="Two families, in more words" columns={columns} rows={rows} />
</div>