View .md

MuxForms on Astro is embed.js in src/layouts or a small client:load island that calls window.MuxForms.mount after navigation. Allow your production Astro origin (Cloudflare, Netlify, or Vercel URL).

Docs

Astro

Astro pages stay mostly static—drop the embed in a layout and let MuxForms handle POST.

Astro

PieceLocation
ScriptBase layout <head> or before </body>
Mount targetPage or Contact.astro
Client navmount() in island if needed
AllowlistDeployed site origin

Contact.astro

---
// src/pages/contact.astro
import Base from "../layouts/Base.astro";
---
<Base title="Contact">
  <h1>Contact</h1>
  <div data-form-id="FORM_UUID"></div>
</Base>

Base layout script

<!-- src/layouts/Base.astro (excerpt) -->
<body>
  <slot />
  <script src="https://www.muxforms.com/embed.js" defer></script>
</body>

Common questions

SSR vs static?
Embed works in both; allowlist uses the public URL.
View Transitions?
Call MuxForms.mount on the new contact page container after transition.
React integration?
Use @muxforms/react inside a client:load React island.
Secret in Astro?
Use Astro server endpoints to POST with ingest secret for custom HTML forms.

Content sites, one inbox.

Blog on Astro, app on Expo—same MuxForms form id optional.

Upgrade to Pro