Marketing sectionsContact
Searchastronomic.dev# Contact
To build your own contact layout: a section heading and your details, a message form or ways to reach you. For a ready layout, use ContactSplit or ContactChannels.
Static: no JavaScript.
## Usage
```astro
import Contact from "@astronomic-dev/ui/components/Contact.astro";
```
## Examples
### Slots
The section is a shell: the eyebrow, the heading and the text always show in that order, then the body in the default slot: here ContactInfo beside a MessageForm, laid out by bodyClass. The shell sets the type and the gaps; the recipes lay out the body. ContactSplit and ContactChannels are recipes built on it, and Pro adds ContactForm and ContactDetails. The form posts to # here.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import Contact from "@astronomic-dev/ui/components/Contact.astro";
import ContactInfo from "@astronomic-dev/ui/components/ContactInfo.astro";
import MessageForm from "@astronomic-dev/ui/components/MessageForm.astro";
---
<div class="mx-auto max-w-6xl px-6 py-16">
<Contact heading="Write to the studio" text="Tell us about your project. A person from the studio reads every message." bodyClass="gap-blocks @3xl/contact:grid-cols-2 @3xl/contact:items-start @3xl/contact:gap-x-group">
<Badge slot="eyebrow">Contact</Badge>
<ContactInfo email="hello@astronomic.example" phone="+1 (312) 555-0147" />
<MessageForm action="#" />
</Contact>
</div>
```
## Props
### Contact
| 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 body. |
| `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. Channel titles sit one level under it. |
| `align` | `"start" \| "center"` | `"start"` | For recipes. The alignment of the header (SectionHead) only: the recipe lays out the body. |
| `contentClass` | `string` | None | For recipes. Classes for the row that holds the header and the body, such as a split from a container width. |
| `headerClass` | `string` | None | For recipes. Classes for the header (the eyebrow, the heading and the text). |
| `bodyClass` | `string` | None | For recipes. Classes for the body box (the details, the form or the channels), such as its columns and gaps. It sits inside the contact container, so its classes can query it (@3xl/contact:...). |
| `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. |
| `default` | The body: ContactInfo, a MessageForm, a list of channels, or your own. |
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.
- The body is a box, not a list: what you put in it is read in the order you write it. Put the details before a form, so a reader who wants only the phone number finds it first.
- Channel titles, if you show any, sit one level under the section heading: pass childHeadingTag({ heading, headingTag }) from lib/heading.ts; with no heading it gives an h3.
Contact
FreeTo build your own contact layout: a section heading and your details, a message form or ways to reach you. For a ready layout, use ContactSplit or ContactChannels.
- File
- Contact.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 body in the default slot: here ContactInfo beside a MessageForm, laid out by bodyClass. The shell sets the type and the gaps; the recipes lay out the body. ContactSplit and ContactChannels are recipes built on it, and Pro adds ContactForm and ContactDetails. The form posts to # here.
This preview did not load.
main.astro
examples/contact/main.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import Contact from "@astronomic-dev/ui/components/Contact.astro";
import ContactInfo from "@astronomic-dev/ui/components/ContactInfo.astro";
import MessageForm from "@astronomic-dev/ui/components/MessageForm.astro";
---
<div class="mx-auto max-w-6xl px-6 py-16">
<Contact heading="Write to the studio" text="Tell us about your project. A person from the studio reads every message." bodyClass="gap-blocks @3xl/contact:grid-cols-2 @3xl/contact:items-start @3xl/contact:gap-x-group">
<Badge slot="eyebrow">Contact</Badge>
<ContactInfo email="hello@astronomic.example" phone="+1 (312) 555-0147" />
<MessageForm action="#" />
</Contact>
</div>Minimal · Light