---
title: Contact Blocks for Astro
description: "Astro contact form blocks with labelled fields and contact links. Preview layouts and install the source, then connect your form service."
seo:
    title: "Astro Contact blocks: examples and source"
sidebar:
    label: "Contact"
related:
    - /blocks
    - /components
    - /docs/astro-business-websites
---

Each block renders a real form with named, required fields and a submit button.
Set `form.action` to your form handler and `form.method` to `"post"` (the
default) or `"get"`. The blocks do not provide a submission backend.
Pass `form.id` for a stable form ID; field IDs use it as their prefix.

## Split form

Place contact methods beside a labelled enquiry form.

```astro
---
import Contact1Block from "@/components/blocks/contact/contact-1.astro"
---

<Contact1Block
  title="Tell us what needs attention"
  description="Describe the item, the damage, and when you can bring it to the studio. These contact details are fictional."
  contactItems={[
    {
      icon: "mail",
      title: "Email us",
      description: "studio@example.com",
      href: "mailto:studio@example.com",
    },
    {
      icon: "phone",
      title: "Call us",
      description: "+1 202 555 0147",
      href: "tel:+12025550147",
    },
    {
      icon: "map-pin",
      title: "Visit us",
      description: "14 Sample Lane, Example City",
      href: "https://example.com/morrow/visit",
    },
    {
      icon: "clock",
      title: "Support hours",
      description: "Tuesday to Friday, 10 am to 4 pm",
    },
  ]}
  form={{
    legend: "Contact form",
    nameLabel: "Name",
    namePlaceholder: "Leila Moreno",
    emailLabel: "Email",
    emailPlaceholder: "leila@example.com",
    messageLabel: "Message",
    messagePlaceholder: "Describe the item and the part that needs attention.",
    messageDescription:
      "Include the material, visible damage, and a preferred visit date.",
    actionLabel: "Send message",
  }}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-1
```

## Centered form

Give the form a central position after the contact introduction.

```astro
---
import Contact2Block from "@/components/blocks/contact/contact-2.astro"
---

<Contact2Block
  title="Arrange a visit to the Morrow studio"
  description="Describe the item, the damage, and when you can bring it to the studio. These contact details are fictional."
  contactItems={[
    {
      icon: "mail",
      title: "Email",
      description: "studio@example.com",
      href: "mailto:studio@example.com",
    },
    {
      icon: "phone",
      title: "Phone",
      description: "+1 202 555 0147",
      href: "tel:+12025550147",
    },
    {
      icon: "map-pin",
      title: "Office",
      description: "14 Sample Lane, Example City",
      href: "https://example.com/morrow/visit",
    },
    {
      icon: "clock",
      title: "Hours",
      description: "Tuesday to Friday, 10 am to 4 pm",
    },
  ]}
  form={{
    title: "Send us a message",
    legend: "Contact form",
    nameLabel: "Name",
    namePlaceholder: "Owen Patel",
    emailLabel: "Email",
    emailPlaceholder: "owen@example.com",
    messageLabel: "Message",
    messagePlaceholder:
      "We are refreshing our docs and need reusable sections for onboarding, changelogs, and feature launches.",
    actionLabel: "Send message",
  }}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-2
```

## Sidebar form

Keep the contact information available beside the enquiry fields.

```astro
---
import Contact3Block from "@/components/blocks/contact/contact-3.astro"
---

<Contact3Block
  title="Ask about a repair or collection"
  description="Describe the item, the damage, and when you can bring it to the studio. These contact details are fictional."
  contactItems={[
    {
      icon: "mail",
      title: "Email",
      description: "studio@example.com",
      href: "mailto:studio@example.com",
    },
    {
      icon: "phone",
      title: "Phone",
      description: "+1 202 555 0147",
      href: "tel:+12025550147",
    },
    {
      icon: "map-pin",
      title: "Office",
      description: "14 Sample Lane, Example City",
      href: "https://example.com/morrow/visit",
    },
    {
      icon: "clock",
      title: "Hours",
      description: "Tuesday to Friday, 10 am to 4 pm",
    },
  ]}
  form={{
    legend: "Contact form",
    nameLabel: "Name",
    namePlaceholder: "Nadia Chen",
    emailLabel: "Email",
    emailPlaceholder: "nadia@example.com",
    messageLabel: "Message",
    messagePlaceholder: "Tell us what you want to bring to the studio.",
    actionLabel: "Send message",
  }}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-3
```

## Contact details and form

Supply your own content. The section uses the selected project preset.

```astro
---
import Block from "@/components/blocks/contact/contact-details-form/contact-details-form.astro"
import type { DetailsFormContent } from "@/components/blocks/contact/contact-details-form/types"
const content = {
  email: "hello@gnotch.example",
  phone: "+1 (212) 555-0148",
  hours: "Monday–Friday, 9 AM–5 PM ET",
  address: "New York · Working everywhere",
  label: "Prepare email",
  description:
    "This form opens your email app. Review and send your message there.",
} satisfies DetailsFormContent
---

<Block {content} />
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-details-form
```

<AutoTypeTable
    path="../../packages/ui/src/components/blocks/contact/contact-details-form/types.ts"
    name="DetailsFormProps"
/>

## Editorial contact

Use this section for a project enquiry with a form endpoint or email draft fallback.

```astro
---
import Section from "@/components/blocks/contact/contact-agency.astro"
const section = {
  label: "Your next chapter",
  title: "Make room",
  accent: "for what’s next",
  description:
    "Tell us about your practice and the story you want to tell. We will help you find a useful place to start.",
  email: "hello@foldline.example",
  companyTypes: [
    "Architecture practice",
    "Interior design studio",
    "Furniture maker",
    "Hospitality",
    "Other",
  ],
  serviceOptions: [
    "Brand foundations",
    "Studio website",
    "Project stories",
    "Launch support",
    "Other",
  ],
  buttonLabel: "Create email draft",
  formTitle: "Tell us about your studio",
  image: {
    src: "/media/foldline/fold-sculpture.svg",
    alt: "",
  },
}
---

<Section {...section} id="contact-agency-editorial" />
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-agency
```

<AutoTypeTable
    path="../../packages/ui/src/components/blocks/shared/agency/types.ts"
    name="AgencyContactProps"
/>

See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section.

## Home services area

```astro
---
import Block from "@/components/blocks/contact/contact-remodify-area.astro"
const content = {
  eyebrow: "Close to Home",
  title: "Rooted in Raleigh.",
  map: {
    src: "https://www.openstreetmap.org/export/embed.html?bbox=-78.98%2C35.63%2C-78.48%2C35.99&layer=mapnik",
    title: "Map of Raleigh, Cary, Apex, and nearby communities",
    href: "https://www.openstreetmap.org/#map=11/35.80/-78.73",
    label: "Explore the Raleigh service area",
  },
  mapTitle: "Your Neighborhood. Your Home.",
  description:
    "Planning a remodel in the Triangle? Tell us where you live and what you have in mind.",
  locations: [
    "Raleigh",
    "Cary",
    "Apex",
    "Morrisville",
    "Garner",
    "Wake Forest",
    "Holly Springs",
    "Knightdale",
  ],
  benefits: [
    "Kitchen and bathroom remodeling",
    "Whole-home renovations",
    "Interior updates and finish carpentry",
  ],
  action: {
    label: "Check Your Location",
    href: "#contact",
  },
  phone: {
    label: "(919) 555-0142",
    href: "tel:+19195550142",
  },
}
---

<Block {...content} />
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-remodify-area
```

## Home services contact

```astro
---
import Block from "@/components/blocks/contact/contact-remodify.astro"
const content = {
  eyebrow: "Start With a Conversation",
  title: "What Could Home Be?",
  description:
    "Tell us about your space, location, and plans. The next step is a conversation about what is possible.",
  image: {
    src: "https://images.unsplash.com/photo-1762146828422-50a8bd416d3c?auto=format&fit=max&w=1600&q=80",
    alt: "Architectural drawings spread across a work surface",
  },
  services: [
    "Kitchen Remodeling",
    "Bathroom Remodeling",
    "Whole-Home Renovation",
    "Interior Updates",
  ],
  budgets: [
    "Under $25,000",
    "$25,000 - $75,000",
    "$75,000 - $150,000",
    "$150,000+",
    "Help me plan a budget",
  ],
  submitLabel: "Discuss My Remodel",
  demoNotice: "Sample form. No request will be sent.",
  demoMessage: "Your sample request is complete. No message was sent.",
}
---

<Block {...content} id="contact-remodify" />
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-remodify
```

## Business hours and booking

An address, opening hours, email, and a configurable booking link.

```astro
---
import Block from "@/components/blocks/contact/contact-hours.astro"
const content = {
  eyebrow: "Come as you are",
  title: "Make a little time\nfor yourself.",
  description:
    "Tell us what you have in mind. We will help you find the right appointment.",
  address: ["Sable Hair Studio", "12 Example Street", "Your town"],
  hours: [
    {
      label: "Tuesday–Friday",
      value: "10 am–7 pm",
    },
    {
      label: "Saturday",
      value: "9 am–5 pm",
    },
    {
      label: "Sunday–Monday",
      value: "Closed",
    },
  ],
  action: {
    label: "Email for an appointment",
    href: "mailto:hello@example.com",
  },
  email: "hello@example.com",
  note: "Demo salon. Address, hours, and prices are sample content.",
}
---

<Block {...content} />
```

```sh
bunx --bun shadcn@latest add @gnostic/contact-hours
```

## Choose a contact layout

Choose the contact layout from the ways people can actually reach you. A small site may need only direct links; a detailed enquiry can use a form with a short explanation of the next step.

## Pass content from Astro

Contact form variants accept content labels and form action/method props. Connect those to a real endpoint or Astro action. The block displays the form but does not send mail, validate server-side rules, or store submissions by itself.

## Responsive layout and images

Check label wrapping, error messages, and keyboard order on a narrow screen. Keep email and phone links usable without the form. If a variant includes an image, supply useful context rather than an image that competes with the fields.

## Compose the next section

Place [Services](/blocks/services) or [FAQs](/blocks/faqs) before contact when they answer common questions. Use [Field](/components/field) for extra form fields.
