Marketing sectionsFaqSplit
Searchastronomic.dev# FaqSplit
To answer questions beside a heading that stays in view while the reader scrolls them.
Static: no JavaScript.
## Usage
```astro
import FaqSplit from "@astronomic/ui-pro/components/FaqSplit.astro";
```
## Examples
### Eight questions
From a 48rem section the header takes the start third and the questions the other two; as the questions scroll, the header stays in view. Narrower, it stacks as FaqList and the header scrolls with the page. Without a heading there is no start column: it renders as FaqList.
```astro
---
import FaqSplit from "@astronomic/ui-pro/components/FaqSplit.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.",
},
{
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.",
},
{
question: "Do you write the copy?",
answer: [
"We write the first draft with you from the brief and a short interview with your team.",
"You edit it in the site's editor until it sounds like you; we check every page before launch.",
],
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<FaqSplit heading="Questions" text="What firms ask us before a first call. Anything else, write to us." items={items} openFirst />
</div>
```
### Under a sticky Navbar
The header sticks below the bar, not under it: it reads the same inset the kit gives the page for in-page jumps (--ui-nav-offset, else a height that covers the kit's bars), plus an item gap. Under a sticky header of your own, set --ui-nav-offset on <html> to its height. In a frame of fixed height: scroll inside it.
```astro
---
import NavbarSimple from "@astronomic-dev/ui/components/NavbarSimple.astro";
import FaqSplit from "@astronomic/ui-pro/components/FaqSplit.astro";
import Star from "../../logos/astronomic-star.svg";
const links = [
{ label: "Work", href: "#work" },
{ label: "Services", href: "#services" },
{ label: "Questions", href: "#questions", current: true },
];
const actions = [{ label: "Start a project", href: "#start" }];
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.",
},
{
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.",
},
{
question: "Do you write the copy?",
answer: [
"We write the first draft with you from the brief and a short interview with your team.",
"You edit it in the site's editor until it sounds like you; we check every page before launch.",
],
},
];
---
<div>
<NavbarSimple sticky links={links} actions={actions} label="Astronomic">
<a slot="brand" href="#" class="inline-flex items-center gap-2 text-inherit no-underline">
<Star class="size-5 shrink-0" aria-hidden="true" />
Astronomic
</a>
</NavbarSimple>
<div class="mx-auto max-w-6xl px-6 py-16">
<FaqSplit id="questions" heading="Questions" text="What firms ask us before a first call. Anything else, write to us." items={items} openFirst />
</div>
</div>
```
## Props
### FaqSplit
| 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.
- The header sticks only from 48rem; below that it scrolls with the page.
FaqSplit
ProTo answer questions beside a heading that stays in view while the reader scrolls them.
- File
- FaqSplit.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
Eight questions
From a 48rem section the header takes the start third and the questions the other two; as the questions scroll, the header stays in view. Narrower, it stacks as FaqList and the header scrolls with the page. Without a heading there is no start column: it renders as FaqList.
This preview did not load.
examples/faqsplit/main.astro
---
import FaqSplit from "@astronomic/ui-pro/components/FaqSplit.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.",
},
{
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.",
},
{
question: "Do you write the copy?",
answer: [
"We write the first draft with you from the brief and a short interview with your team.",
"You edit it in the site's editor until it sounds like you; we check every page before launch.",
],
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<FaqSplit heading="Questions" text="What firms ask us before a first call. Anything else, write to us." items={items} openFirst />
</div>Under a sticky Navbar
The header sticks below the bar, not under it: it reads the same inset the kit gives the page for in-page jumps (--ui-nav-offset, else a height that covers the kit's bars), plus an item gap. Under a sticky header of your own, set --ui-nav-offset on <html> to its height. In a frame of fixed height: scroll inside it.
This preview did not load.
examples/faqsplit/sticky.astro
---
import NavbarSimple from "@astronomic-dev/ui/components/NavbarSimple.astro";
import FaqSplit from "@astronomic/ui-pro/components/FaqSplit.astro";
import Star from "../../logos/astronomic-star.svg";
const links = [
{ label: "Work", href: "#work" },
{ label: "Services", href: "#services" },
{ label: "Questions", href: "#questions", current: true },
];
const actions = [{ label: "Start a project", href: "#start" }];
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.",
},
{
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.",
},
{
question: "Do you write the copy?",
answer: [
"We write the first draft with you from the brief and a short interview with your team.",
"You edit it in the site's editor until it sounds like you; we check every page before launch.",
],
},
];
---
<div>
<NavbarSimple sticky links={links} actions={actions} label="Astronomic">
<a slot="brand" href="#" class="inline-flex items-center gap-2 text-inherit no-underline">
<Star class="size-5 shrink-0" aria-hidden="true" />
Astronomic
</a>
</NavbarSimple>
<div class="mx-auto max-w-6xl px-6 py-16">
<FaqSplit id="questions" heading="Questions" text="What firms ask us before a first call. Anything else, write to us." items={items} openFirst />
</div>
</div>