Marketing sectionsFaqList
Searchastronomic.dev# FaqList
To answer the questions people ask before they get in touch, each one opening on its own.
Static: no JavaScript.
## Usage
```astro
import FaqList from "@astronomic/ui-pro/components/FaqList.astro";
```
## Examples
### Studio questions
The header above, the questions below at full width, the first open on load (openFirst). Each opens on its own.
```astro
---
import FaqList from "@astronomic/ui-pro/components/FaqList.astro";
const items = [
{
question: "How long does a project take?",
answer: "Most sites take six to ten weeks from the first call to launch. A brand and a site together take about twelve.",
},
{
question: "What do you need from us to start?",
answer: [
"A short brief, a contact who can make decisions, and any brand material you already have.",
"We write the first draft of the copy with you, so you do not need finished text.",
],
},
{
question: "Can our team edit the site after launch?",
answer: "Yes. Every page is built for your team to edit, and we train them before the handover.",
},
{
question: "Do you work with firms outside your city?",
answer: "Yes. Most of our clients are elsewhere; we meet by video and visit for workshops when it helps.",
},
];
---
<div class="mx-auto max-w-3xl px-6 py-16">
<FaqList heading="Questions" text="What firms ask us before a first call." items={items} openFirst />
</div>
```
### One at a time
With single, opening a question closes the one that was open. The browser does it; there is no script.
```astro
---
import FaqList from "@astronomic/ui-pro/components/FaqList.astro";
const items = [
{
question: "How do we pay?",
answer: "Half when we start and half at launch, by bank transfer or card. A retainer is billed at the start of each month.",
},
{
question: "What if we need changes after launch?",
answer: "Small fixes in the first month are included. After that, changes go into a retainer or a fixed quote.",
},
{
question: "Who owns the site?",
answer: "You do: the code, the content and the accounts are yours from the day we hand over.",
},
];
---
<div class="mx-auto max-w-3xl px-6 py-16">
<FaqList heading="Billing and handover" items={items} single />
</div>
```
## Props
### FaqList
| 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 questions. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>: exactly two asterisks around text with no space inside, as in "Built for *the long run*". 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. Questions sit one level under it. |
| `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. |
| `itemHeadingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | `"h3"` | The question element when there is no heading. With a heading, questions sit one level under it. |
| `items` | `FaqEntry[]` | None | Required. The questions, in order: { question, answer } (FaqEntry, exported from the recipe), where answer is one string or a list of paragraphs. Only these fields reach each question, so a CMS entry's other fields never land on the page. |
| `openFirst` | `boolean` | `false` | Opens the first question on load. |
| `single` | `boolean` | `false` | One question open at a time: opening one closes the others in this list (native, no script). Each list takes its own group, so two on a page never close each other's. |
| `titleClass` | `string` | None | Classes for every question, after its own (FaqItem's titleClass), so yours win: such as your theme's type role (text-subhead). |
| `iconClass` | `string` | None | Classes for a box around every question's open and close icon (FaqItem's iconClass), such as a 44px round frame: size-11 self-center rounded-full border-ui border-solid border-fg/30. Without it the icon sits bare. |
| 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, renders a <section> named by it, so it is a region landmark. The heading id is unique on the page.
- Without a heading, renders a plain <div>. Put your own heading above it.
- Each question is a native <details> and <summary>, so the keyboard and screen readers work without any script: Enter or Space opens and closes it.
- Each question sits one level under the section heading (h2 gives h3), so the questions are easy to skim by heading. With no heading, it is an h3 unless you set itemHeadingTag.
- Do not put links or other controls in a question: the whole summary is the control.
- Safari with VoiceOver reads a summary as one button and may flatten what is inside it, so the question headings may not show in its heading list. The questions are still reached as buttons. If heading navigation matters there, give the section a heading.
- With single, opening a question closes the others in the same list (the browser does it); in browsers without it, several stay open.
FaqList
ProTo answer the questions people ask before they get in touch, each one opening on its own.
- File
- FaqList.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 2
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Studio questions
The header above, the questions below at full width, the first open on load (openFirst). Each opens on its own.
This preview did not load.
main.astro
examples/faqlist/main.astro
---
import FaqList from "@astronomic/ui-pro/components/FaqList.astro";
const items = [
{
question: "How long does a project take?",
answer: "Most sites take six to ten weeks from the first call to launch. A brand and a site together take about twelve.",
},
{
question: "What do you need from us to start?",
answer: [
"A short brief, a contact who can make decisions, and any brand material you already have.",
"We write the first draft of the copy with you, so you do not need finished text.",
],
},
{
question: "Can our team edit the site after launch?",
answer: "Yes. Every page is built for your team to edit, and we train them before the handover.",
},
{
question: "Do you work with firms outside your city?",
answer: "Yes. Most of our clients are elsewhere; we meet by video and visit for workshops when it helps.",
},
];
---
<div class="mx-auto max-w-3xl px-6 py-16">
<FaqList heading="Questions" text="What firms ask us before a first call." items={items} openFirst />
</div>One at a time
With single, opening a question closes the one that was open. The browser does it; there is no script.
This preview did not load.
single.astro
examples/faqlist/single.astro
---
import FaqList from "@astronomic/ui-pro/components/FaqList.astro";
const items = [
{
question: "How do we pay?",
answer: "Half when we start and half at launch, by bank transfer or card. A retainer is billed at the start of each month.",
},
{
question: "What if we need changes after launch?",
answer: "Small fixes in the first month are included. After that, changes go into a retainer or a fixed quote.",
},
{
question: "Who owns the site?",
answer: "You do: the code, the content and the accounts are yours from the day we hand over.",
},
];
---
<div class="mx-auto max-w-3xl px-6 py-16">
<FaqList heading="Billing and handover" items={items} single />
</div>Minimal · Light