FormsForm

Open in Create
Search
astronomic.dev

Form

Free

To build your own form that posts with no JavaScript: hidden fields, a spam trap, the send button and an optional in-page status. MessageForm and SignupForm are built on it.

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

Examples

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

  • Static
  • Interactive
  • Framed

A plain post

Name and email Fields in the default slot and a privacy line in the note slot; the button and its status come after the fields. It posts to # here. The form is generic: any endpoint that takes a form post works through action, the field names and hiddenFields, with no provider built in. Buttondown, Mailchimp and Formspree are checked examples. A plain post is the safe default.

main.astro

Sent in the page

Sends in the page to the directory's test endpoint, which exists only in development and in tests; on this site, with no endpoint behind it, the preview answers in the page, so it says it was sent and nothing is kept. A real endpoint must answer JSON.

enhanced.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.