Marketing sectionsCtaBand
Searchastronomic.dev# CtaBand
To build your own call-to-action layout: the heading, a line, actions and media on the band, in a fixed order. For a ready layout, use CtaBandSplit, CtaBandCentered, CtaBandImage or CtaBandInline.
Static: no JavaScript.
## Usage
```astro
import CtaBand from "@astronomic-dev/ui/components/CtaBand.astro";
```
## Examples
### Slots
The band is a shell: the eyebrow, the heading, the text, the actions and the default slot always show in that order, with the media block after them. The shell sets the band colors, the type, the padding and the gaps; the recipes lay out the blocks. CtaBandSplit is a recipe built on it.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import CtaBand from "@astronomic-dev/ui/components/CtaBand.astro";
const actions = [
{ label: "Book an intro call", href: "#call" },
{ label: "See our rates", href: "#rates" },
];
---
<section class="mx-auto max-w-6xl px-6 py-12">
<CtaBand heading="Have a project in mind?" text="Tell us what you need and when. We answer within two business days." actions={actions}>
<Badge slot="eyebrow">Two openings this spring</Badge>
<a href="mailto:hello@haldenstudio.example">hello@haldenstudio.example</a>
</CtaBand>
</section>
```
### A form on the band
A link, fields, a select, a disclosure and a button in the default slot. Every focusable element shows the band-fg ring on the band, an invalid field too (its red edge and the error mark it), and an element out of the tab order (tabindex="-1") gets none.
```astro
---
import CtaBand from "@astronomic-dev/ui/components/CtaBand.astro";
import Field from "@astronomic-dev/ui/components/Field.astro";
import Input from "@astronomic-dev/ui/components/Input.astro";
import Textarea from "@astronomic-dev/ui/components/Textarea.astro";
import { describedBy } from "@astronomic-dev/ui/lib/field.ts";
const error = "Enter an email address, such as name@example.com.";
const hint = "What you want built, and by when.";
---
<section class="mx-auto max-w-6xl px-6 py-12">
<CtaBand heading="Tell us about your project" text="A few lines are enough. We answer within two business days." actions={[{ label: "Book an intro call", href: "#call" }]}>
<a href="mailto:hello@haldenstudio.example">Or write to hello@haldenstudio.example</a>
<form action="#contact" class="mt-item grid max-w-[32rem] gap-item text-body font-normal">
<Field tone="cta" label="Your name" for="cta-form-name" required>
<Input id="cta-form-name" name="name" autocomplete="name" required />
</Field>
<Field tone="cta" label="Email" for="cta-form-email" error={error}>
<Input id="cta-form-email" type="email" name="email" autocomplete="email" value="halden.studio" invalid aria-describedby={describedBy("cta-form-email", { error })} />
</Field>
<Field tone="cta" label="What do you need?" for="cta-form-brief" hint={hint}>
<Textarea id="cta-form-brief" name="brief" rows={3} aria-describedby={describedBy("cta-form-brief", { hint })} />
</Field>
<Field tone="cta" label="Budget" for="cta-form-budget">
<select id="cta-form-budget" name="budget">
<option>Under 10,000</option>
<option>10,000 to 30,000</option>
<option>Over 30,000</option>
</select>
</Field>
<details>
<summary>What happens next?</summary>
<p class="m-0 mt-2">We read your note, then book a short call to talk it through.</p>
</details>
{/* A scrolling box takes focus, so a keyboard can scroll it; as a named region a screen reader can find it. */}
<div tabindex="0" role="region" aria-label="Opening hours" class="max-h-16 overflow-auto">
<p class="m-0">Monday to Thursday, 9 to 5.</p>
<p class="m-0">Friday, 9 to 3.</p>
<p class="m-0">Weekends and holidays, closed.</p>
<p class="m-0">In August, by email only.</p>
</div>
<div><button type="button">Call me back instead</button></div>
<div tabindex="-1" id="cta-form-status">Your note is not sent yet.</div>
</form>
</CtaBand>
</section>
```
## Props
### CtaBand
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | Required. The heading, in the title role in display type. |
| `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. |
| `actions` | `Omit<NavAction, "size">[]` | `[]` | Buttons on the band (Button tone="cta"). NavAction is { label, href, variant? }. The first is `primary` and the rest `secondary`, unless you set variant. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. |
| `align` | `"start" \| "center"` | `"start"` | For recipes. The alignment of the text and the actions. |
| `headingClass` | `string` | None | For recipes. Classes for the heading, after its own, such as a smaller type role. |
| `contentClass` | `string` | None | For recipes. Classes for the row that holds the padded body and the media block. |
| `bodyClass` | `string` | None | For recipes. Classes for the padded body that holds the text block and the actions block. |
| `textClass` | `string` | None | For recipes. Classes for the text block (the eyebrow, the heading and the text), at the reading width. |
| `actionsClass` | `string` | None | For recipes. Classes for the actions block (the Buttons and the default slot). |
| `mediaClass` | `string` | None | For recipes. Classes for the media block, which has no padding, so an image can reach the band's edge. |
| `class` | `string` | None | More classes, merged with cn(), so yours win on conflicts. A border you add takes the band's edge color. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. |
| `default` | More content under the actions, such as the studio's email link. |
| `media` | An image or other media, in its own block after the body. An empty slot leaves no block. |
Any other attribute goes on the <section>.
## Accessibility
- Renders a <section> named by its heading, so it is a region landmark.
- The focus ring on the band is band-fg, so it shows on the band in every preset.
- Actions are links that look like buttons. Give each a label that says where it goes.
CtaBand
FreeTo build your own call-to-action layout: the heading, a line, actions and media on the band, in a fixed order. For a ready layout, use CtaBandSplit, CtaBandCentered, CtaBandImage or CtaBandInline.
- File
- CtaBand.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
Slots
The band is a shell: the eyebrow, the heading, the text, the actions and the default slot always show in that order, with the media block after them. The shell sets the band colors, the type, the padding and the gaps; the recipes lay out the blocks. CtaBandSplit is a recipe built on it.
This preview did not load.
examples/ctaband/main.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import CtaBand from "@astronomic-dev/ui/components/CtaBand.astro";
const actions = [
{ label: "Book an intro call", href: "#call" },
{ label: "See our rates", href: "#rates" },
];
---
<section class="mx-auto max-w-6xl px-6 py-12">
<CtaBand heading="Have a project in mind?" text="Tell us what you need and when. We answer within two business days." actions={actions}>
<Badge slot="eyebrow">Two openings this spring</Badge>
<a href="mailto:hello@haldenstudio.example">hello@haldenstudio.example</a>
</CtaBand>
</section>A form on the band
A link, fields, a select, a disclosure and a button in the default slot. Every focusable element shows the band-fg ring on the band, an invalid field too (its red edge and the error mark it), and an element out of the tab order (tabindex="-1") gets none.
This preview did not load.
examples/ctaband/form.astro
---
import CtaBand from "@astronomic-dev/ui/components/CtaBand.astro";
import Field from "@astronomic-dev/ui/components/Field.astro";
import Input from "@astronomic-dev/ui/components/Input.astro";
import Textarea from "@astronomic-dev/ui/components/Textarea.astro";
import { describedBy } from "@astronomic-dev/ui/lib/field.ts";
const error = "Enter an email address, such as name@example.com.";
const hint = "What you want built, and by when.";
---
<section class="mx-auto max-w-6xl px-6 py-12">
<CtaBand heading="Tell us about your project" text="A few lines are enough. We answer within two business days." actions={[{ label: "Book an intro call", href: "#call" }]}>
<a href="mailto:hello@haldenstudio.example">Or write to hello@haldenstudio.example</a>
<form action="#contact" class="mt-item grid max-w-[32rem] gap-item text-body font-normal">
<Field tone="cta" label="Your name" for="cta-form-name" required>
<Input id="cta-form-name" name="name" autocomplete="name" required />
</Field>
<Field tone="cta" label="Email" for="cta-form-email" error={error}>
<Input id="cta-form-email" type="email" name="email" autocomplete="email" value="halden.studio" invalid aria-describedby={describedBy("cta-form-email", { error })} />
</Field>
<Field tone="cta" label="What do you need?" for="cta-form-brief" hint={hint}>
<Textarea id="cta-form-brief" name="brief" rows={3} aria-describedby={describedBy("cta-form-brief", { hint })} />
</Field>
<Field tone="cta" label="Budget" for="cta-form-budget">
<select id="cta-form-budget" name="budget">
<option>Under 10,000</option>
<option>10,000 to 30,000</option>
<option>Over 30,000</option>
</select>
</Field>
<details>
<summary>What happens next?</summary>
<p class="m-0 mt-2">We read your note, then book a short call to talk it through.</p>
</details>
{/* A scrolling box takes focus, so a keyboard can scroll it; as a named region a screen reader can find it. */}
<div tabindex="0" role="region" aria-label="Opening hours" class="max-h-16 overflow-auto">
<p class="m-0">Monday to Thursday, 9 to 5.</p>
<p class="m-0">Friday, 9 to 3.</p>
<p class="m-0">Weekends and holidays, closed.</p>
<p class="m-0">In August, by email only.</p>
</div>
<div><button type="button">Call me back instead</button></div>
<div tabindex="-1" id="cta-form-status">Your note is not sent yet.</div>
</form>
</CtaBand>
</section>