0.1.12 ā¢ Published 4 months ago
simple-stack-form v0.1.12
Simple form š§āāļø
The simple way to handle forms in your Astro project
---
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
}
---
<form method="POST">
<label for="quantity">Quantity</label>
<input id="quantity" {...checkout.inputProps.quantity} />
<label for="email">Email</label>
<input id="email" {...checkout.inputProps.email} />
<label for="allowAlerts">Allow alerts</label>
<input id="allowAlerts" {...checkout.inputProps.allowAlerts} />
</form>
š Visit the docs for more information and usage examples.
0.1.12
4 months ago
0.1.11
4 months ago
0.1.10
4 months ago
0.1.8
4 months ago
0.1.7
4 months ago
0.1.9
4 months ago
0.1.6
4 months ago
0.1.5
5 months ago
0.1.4
5 months ago
0.1.3
5 months ago
0.1.2
5 months ago
0.1.0
5 months ago
0.1.1
5 months ago
0.0.5
5 months ago
0.0.6
5 months ago
0.0.4
6 months ago
0.0.3
6 months ago
0.0.2
6 months ago
0.0.1
6 months ago