# simple-stack-form

> A simple form library for Astro projects

Latest version **0.1.12** (published 2024-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-stack-form
pnpm add simple-stack-form
yarn add simple-stack-form
bun add simple-stack-form
```

Provides the command `simple-form`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.12 |
| Published | 2024-01-23 |
| First published | 2023-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 4 |
| Unpacked size | 139.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 459 |
| Author | bholmesdev |
| Maintainers | bholmesdev |
| Keywords | withastro, astro-integration |

## Links

- npm: https://www.npmjs.com/package/simple-stack-form
- Repository: https://github.com/bholmesdev/simple-stack
- Homepage: https://github.com/bholmesdev/simple-stack#readme
- Issues: https://github.com/bholmesdev/simple-stack/issues
- npm.io page: https://npm.io/package/simple-stack-form

## Dependencies (4)

- [kleur](https://npm.io/package/kleur.md) ^4.1.5
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0
- [@clack/prompts](https://npm.io/package/@clack/prompts.md) ^0.7.0
- [just-map-values](https://npm.io/package/just-map-values.md) ^3.2.0

## Recent versions

- 0.1.12 (latest) — 2024-01-23
- 0.1.11 — 2024-01-17
- 0.1.10 — 2024-01-15
- 0.1.9 — 2024-01-10
- 0.1.8 — 2024-01-10
- 0.1.7 — 2024-01-10
- 0.1.6 — 2024-01-01
- 0.1.5 — 2023-12-26
- 0.1.4 — 2023-12-21
- 0.1.3 — 2023-12-21
- 0.1.2 — 2023-12-14
- 0.1.1 — 2023-12-11
- 0.1.0 — 2023-12-11
- 0.0.6 — 2023-12-08
- 0.0.5 — 2023-12-08
- … 4 more at https://npm.io/package/simple-stack-form/versions

## README

# Simple 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
}
---

<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](https://simple-stack.dev/form) for more information and usage examples.

---
_Source: https://npm.io/package/simple-stack-form · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
