Contact Blocks for Astro
Astro contact form blocks with labelled fields and contact links. Preview layouts and install the source, then connect your form service.
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.
bunx --bun shadcn@latest add @gnostic/contact-split-formnpx shadcn@latest add @gnostic/contact-split-formpnpm dlx shadcn@latest add @gnostic/contact-split-formCentered form
Give the form a central position after the contact introduction.
bunx --bun shadcn@latest add @gnostic/contact-centered-formnpx shadcn@latest add @gnostic/contact-centered-formpnpm dlx shadcn@latest add @gnostic/contact-centered-formSidebar form
Keep the contact information available beside the enquiry fields.
bunx --bun shadcn@latest add @gnostic/contact-3npx shadcn@latest add @gnostic/contact-3pnpm dlx shadcn@latest add @gnostic/contact-3Contact details and form
Supply your own content. The section uses the selected project preset.
bunx --bun shadcn@latest add @gnostic/contact-details-formnpx shadcn@latest add @gnostic/contact-details-formpnpm dlx shadcn@latest add @gnostic/contact-details-formcontentDetailsFormContent
Section content.
DetailsFormContentclass?string
Classes added to the root.
stringEditorial contact
Use this section for a project enquiry with a form endpoint or email draft fallback.
bunx --bun shadcn@latest add @gnostic/contact-project-inquirynpx shadcn@latest add @gnostic/contact-project-inquirypnpm dlx shadcn@latest add @gnostic/contact-project-inquirySee serif accent font setup when installing this section.
Service map
bunx --bun shadcn@latest add @gnostic/contact-service-mapnpx shadcn@latest add @gnostic/contact-service-mappnpm dlx shadcn@latest add @gnostic/contact-service-mapEstimate form
bunx --bun shadcn@latest add @gnostic/contact-estimate-formnpx shadcn@latest add @gnostic/contact-estimate-formpnpm dlx shadcn@latest add @gnostic/contact-estimate-formBusiness hours and booking
An address, opening hours, email, and a configurable booking link.
bunx --bun shadcn@latest add @gnostic/contact-hoursnpx shadcn@latest add @gnostic/contact-hourspnpm dlx shadcn@latest add @gnostic/contact-hoursChoose 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 or FAQs before contact when they answer common questions. Use Field for extra form fields.
Named slots
These slots are optional. Use the slot name on a direct child of the block.
contact-service-map
map?Astro content
Replaces the embedded service map.
Astro contentIframe from data.mapcontact-estimate-form
image?Astro content
Replaces the image beside the estimate form.
Astro contentAstro Image from data.imagecontact-icon-block
icon?Astro content
Places an icon before the contact details.
Astro content