Marketing sectionsServicesList
Searchastronomic.dev# ServicesList
To build your own services layout: a section heading and numbered rows that each open to show what a service includes. For a ready layout, use ServicesAccordion.
Static: no JavaScript.
## Usage
```astro
import ServicesList from "@astronomic/ui-pro/components/ServicesList.astro";
```
## Examples
### Slots
The shell: the eyebrow, the heading and the text, then one numbered row per service, in that order. It numbers the rows and gives each title its level. ServicesAccordion is the recipe built on it.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import ServicesList from "@astronomic/ui-pro/components/ServicesList.astro";
const services = [
{ title: "Brand identity", text: "Positioning, logo and type systems.", tags: ["Wordmark", "Guidelines"] },
{ title: "Websites", text: "Marketing sites built in Astro.", tags: ["Design", "Astro build"] },
];
---
<Container class="py-16">
<ServicesList heading="Services" text="The shell: the header, then one numbered row per service. ServicesAccordion lays out each body." items={services} openFirst>
<Badge slot="eyebrow">What we do</Badge>
</ServicesList>
</Container>
```
## Props
### ServicesList
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `ServiceEntry[]` | None | Required. One or more services, numbered from (01) in this order: { title, text?, image?, tags?, link? }. Only these fields reach the markup. Empty throws. |
| `numberFormat` | `"paren" \| "slash"` | `"paren"` | How the services' numbers show: paren, "(01)", or slash, "01 /" (the slash in the number's own type and color). |
| `heading` | `string` | None | The section heading. Without it there is no section and no header: a <div> holds only the services. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>. |
| `mark` | `string` | None | A short mark after the heading, such as "(5)". Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "5 services". Without it, the mark is read as written. |
| `text` | `string` | None | One or two sentences under the heading. Shown only with a heading. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The section heading's element. Each title sits one level under it. |
| `itemHeadingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | `"h3"` | The titles' element when there is no heading. |
| `exclusive` | `boolean` | `false` | One service open at a time: opening one closes the others (native, no script). Each list gets its own group. |
| `openFirst` | `boolean` | `false` | Open the first service on load. |
| `tone` | `"page" \| "inverse"` | `"page"` | The surface it sits on. inverse: on Panel tone="inverse": the header, the rows and the focus ring take the panel's colors. |
| `imageComponent` | `ImageComponent` | None | Your image component for every service's photo (Media's imageComponent). |
| `imageSizes` | `string` | None | How wide each photo shows, for imageComponent's sizes. |
| `class` | `string` | None | More classes on the root, merged with cn(), so yours win on conflicts. |
| `align` | `"start" \| "center"` | `"start"` | For recipes: the alignment of the header only. |
| `contentClass` | `string` | None | For recipes: the row that holds the header and the services. |
| `headerClass` | `string` | None | For recipes: the header (SectionHead). |
| `listClass` | `string` | None | For recipes: the box that holds the services. |
| `bodyClass` | `string` | None | For recipes: each service's body (its text, photo, tags and link), such as its columns. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short label above the heading. Shown only with a heading. |
Any other attribute goes on the root (<section>, or <div> without a heading).
## Accessibility
- With a heading, renders a <section> named by it, so it is a region landmark. The heading id is unique on the page. Without one, a plain <div>: put your own heading above it.
- Each service is a native <details> and <summary>, so the keyboard and screen readers work without any script: Enter or Space opens and closes it.
- The summary's name is the service's title: the number and the chevron are hidden from screen readers. The title is a heading one level under the section heading.
- Every summary is at least 44px tall, so it is easy to tap. The link in the body is a 44px box on touch.
- Safari with VoiceOver reads a summary as one button and may flatten what is inside it, so the titles may not show in its heading list. They are still reached as buttons.
- Open, the chevron points up. It turns smoothly only when the reader allows motion and the theme is not calm; otherwise it flips at once.
ServicesList
ProTo build your own services layout: a section heading and numbered rows that each open to show what a service includes. For a ready layout, use ServicesAccordion.
- File
- ServicesList.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 shell: the eyebrow, the heading and the text, then one numbered row per service, in that order. It numbers the rows and gives each title its level. ServicesAccordion is the recipe built on it.
This preview did not load.
main.astro
examples/serviceslist/main.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import ServicesList from "@astronomic/ui-pro/components/ServicesList.astro";
const services = [
{ title: "Brand identity", text: "Positioning, logo and type systems.", tags: ["Wordmark", "Guidelines"] },
{ title: "Websites", text: "Marketing sites built in Astro.", tags: ["Design", "Astro build"] },
];
---
<Container class="py-16">
<ServicesList heading="Services" text="The shell: the header, then one numbered row per service. ServicesAccordion lays out each body." items={services} openFirst>
<Badge slot="eyebrow">What we do</Badge>
</ServicesList>
</Container>Minimal · Light