How to add a form to Astro

Astro sites are static by default, which makes forms awkward. With FormTango the form is plain HTML in your .astro file, and no adapter or endpoint is needed.
  1. 1

    Create a free FormTango account and add a form. Copy its endpoint, which looks like https://formtango.com/f/YOUR_FORM_ID.

  2. 2

    Add the form to a page or component, replacing YOUR_FORM_ID.

  3. 3

    Submit the form once. The submission appears in your FormTango inbox and you get an email.

astro
---
// src/pages/contact.astro
---
<form action="https://formtango.com/f/YOUR_FORM_ID" method="POST">
  <label>Email <input type="email" name="email" required /></label>
  <label>Message <textarea name="message" required></textarea></label>
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off" />
  <button type="submit">Send</button>
</form>

What you get

  • Every submission saved in an inbox you can search and export.
  • An email for each one, with the visitor's address as the reply-to.
  • Spam filtering without making visitors solve a puzzle.
  • Problems? See troubleshooting.

Related guides

HTMLJavaScript (no page reload)ReactNext.jsVue

Last reviewed November 19, 2026.