Contact form for Astro
Astro's whole point is shipping zero JavaScript by default, and FormDock keeps it that way: a plain HTML form in any .astro component, no client:load, no server endpoints, fully static output.
src/components/ContactForm.astro
--- // No frontmatter needed — this is a zero-JS component --- <form action="https://formdock.app/f/your-form-key" method="POST"> <input type="text" name="name" placeholder="Name" required /> <input type="email" name="email" placeholder="Email" required /> <textarea name="message" placeholder="Message"></textarea> <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off" /> <button type="submit">Send</button> </form>
- Fastest start: our free starter template — a complete one-page studio site with the form pre-wired: github.com/form-dock/formdock-starter-astro (MIT, 'Use this template').
- Works with output: 'static' — no adapter, no SSR needed.
- Set your form's redirect URL to a /thanks page in your Astro site for a fully branded flow.
- If you prefer staying on-page, progressive-enhance with a small fetch script — see the React guide for the pattern.
Get your endpoint: create a free FormDock account (100 submissions/month), add a form, and swap your-form-key for the real key.