A simple form library for Astro projects
npm install simple-stack-form> The simple way to handle forms in your Astro project
``astro
---
import { z } from "zod";
import { createForm } from "simple:form";
const checkout = createForm({
quantity: z.number(),
email: z.string().email(),
allowAlerts: z.boolean(),
});
const result = await Astro.locals.form.getData(checkout);
if (result?.data) {
await myDb.insert(result.data);
// proceed to checkout
}
---
š Visit the docs for more information and usage examples.