Marketing sectionsIndexList
Searchastronomic.dev# IndexList
To build your own index: a short list of names, each with a marker and an optional count or note. For a ready layout, use IndexListColumns or IndexListSplit.
Static: no JavaScript.
## Usage
```astro
import IndexList from "@astronomic-dev/ui/components/IndexList.astro";
```
## Examples
### Slots
The section is a shell: the eyebrow, the heading and the text always show in that order, then the ruled list, each row a marker, the label and its meta. The shell sets the type, the rows and the gaps; listClass sets the list's columns. IndexListColumns and IndexListSplit are recipes built on it.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import IndexList from "@astronomic-dev/ui/components/IndexList.astro";
// The directory's own groups, each with its page and a count.
const groups = [
{ label: "Marketing sections", href: "#marketing", meta: "58 parts" },
{ label: "Data display", href: "#data-display", meta: "23 parts" },
{ label: "Navigation", href: "#navigation", meta: "16 parts" },
{ label: "Forms", href: "#forms", meta: "7 parts" },
{ label: "Publishing sections", href: "#publishing", meta: "5 parts" },
{ label: "Layout", href: "#layout", meta: "5 parts" },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<!-- The shell lays out no list: listClass sets its columns (two from a 42rem index container). -->
<IndexList heading="What the kit covers" text="Every part of Astronomic UI, by group." items={groups} listClass="gap-x-blocks @2xl/index:grid-cols-2">
<Badge slot="eyebrow">Directory</Badge>
</IndexList>
</div>
```
## Props
### IndexList
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | The section heading, in the title role in display type. Without it there is no section and no header: a plain <div> holds only the list. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>: exactly two asterisks around text with no space inside, as in "Where we *know* the ground". Any other asterisks show as typed. Off by default, so the heading shows as typed. How the <em> looks is the theme's. |
| `mark` | `string` | None | A short mark after the heading, such as "(12)" or "©2026", in small muted type. It sits beside the heading, outside it, so the heading's name stays plain. Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "12 projects": the mark is then hidden from screen readers and this is read in its place. Without it, the mark is read as written. |
| `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. The rows are not headings: each is a label. |
| `items` | `IndexItem[]` | None | Required. The rows, in order: { label, href?, meta? }. label is the row's name, in the subhead role; with href the whole row is one link named by it; meta is your own short text after it, such as "31 clients" or "6 weeks", small and muted, wrapping in a column at most 40% of the row. An empty list stops the build. |
| `marker` | `IconComponent` | None | The mark at the start of each row: your icon component (e.g. a star), at the small icon size, in the text color. Without it, a small dot in the accent. Decorative. |
| `align` | `"start" \| "center"` | `"start"` | For recipes. The alignment of the header (SectionHead) only: the recipe lays out the list. |
| `contentClass` | `string` | None | For recipes. Classes for the row that holds the header and the list. |
| `headerClass` | `string` | None | For recipes. Classes for the header (the eyebrow, the heading and the text). |
| `listClass` | `string` | None | For recipes. Classes for the list (the <ul>), such as its columns. It sits inside the index container, so its classes can query it (@2xl/index:...). |
| `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 (inline-flex, a float, fit-content) 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
- With a heading it is a region named by it: a <section> whose heading id is unique on the page.
- Without a heading it is a plain <div>. Put your own heading above it.
- The rows are a list, so a screen reader hears "list, N items", then each row in order.
- Each linked row is one link, named by its label; the meta is read after it. A click anywhere on the row follows it, and the focus ring goes round the row, inside its hairlines.
- Rows are at least 44px tall on touch screens.
- The marker is decoration, hidden from screen readers.
IndexList
FreeTo build your own index: a short list of names, each with a marker and an optional count or note. For a ready layout, use IndexListColumns or IndexListSplit.
- File
- IndexList.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Slots
The section is a shell: the eyebrow, the heading and the text always show in that order, then the ruled list, each row a marker, the label and its meta. The shell sets the type, the rows and the gaps; listClass sets the list's columns. IndexListColumns and IndexListSplit are recipes built on it.
This preview did not load.
main.astro
examples/indexlist/main.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import IndexList from "@astronomic-dev/ui/components/IndexList.astro";
// The directory's own groups, each with its page and a count.
const groups = [
{ label: "Marketing sections", href: "#marketing", meta: "58 parts" },
{ label: "Data display", href: "#data-display", meta: "23 parts" },
{ label: "Navigation", href: "#navigation", meta: "16 parts" },
{ label: "Forms", href: "#forms", meta: "7 parts" },
{ label: "Publishing sections", href: "#publishing", meta: "5 parts" },
{ label: "Layout", href: "#layout", meta: "5 parts" },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<!-- The shell lays out no list: listClass sets its columns (two from a 42rem index container). -->
<IndexList heading="What the kit covers" text="Every part of Astronomic UI, by group." items={groups} listClass="gap-x-blocks @2xl/index:grid-cols-2">
<Badge slot="eyebrow">Directory</Badge>
</IndexList>
</div>Minimal · Light