FormsSignupForm

Open in Create
Search
astronomic.dev

SignupForm

Free

For an email signup that posts to your newsletter provider with no JavaScript, such as Buttondown or Mailchimp.

File
SignupForm.astro
Group
Forms
Kind
Interactive: inline script
Examples
3
import SignupForm from "@astronomic-dev/ui/components/SignupForm.astro";

Examples

Drag the orange handle to set the width. Frames get real breakpoints.

  • Static
  • Interactive
  • Framed

A plain post

One email field with its visible label, the button under it, and a privacy line in the note slot. It posts to # here: set action to your provider's endpoint, emailName to the field name it wants, and hiddenFields to anything else it asks for. A plain post is the safe default and works with no JavaScript.

main.astro

Buttondown

Buttondown's row: action is https://buttondown.com/api/emails/embed-subscribe/<user>, with <user> your Buttondown username (copy it from the embed code under Settings, Embedding; example here is a placeholder), the email field is email, and the hidden fields are embed=1 and, if you like, a tag. Use a plain post: Buttondown asks not to send it with fetch, because it may show its own CAPTCHA page. After the post Buttondown shows its own page.

buttondown.astro

Mailchimp

Mailchimp's row: copy the form's action from your audience's embedded form code as it is, with its query (u, id and f_id; the values here are made up). The email field is EMAIL, and the honeypot is Mailchimp's own trap, b_<u>_<id>, from the same code. Use a plain post: the form endpoint answers a page, not JSON. After the post Mailchimp shows its own page.

mailchimp.astro
Minimal · Light

Waitlist

Be first in line

Join the waitlist and we'll email you the moment it's out.

You'll also get our newsletter: new themes, plugins and guides. Unsubscribe any time.