1.8 KiB
1.8 KiB
Astro Reactive Form 🔥
The Reactive Form component for Astro 🔥
All contributions are welcome. Let's make the fastest web form component powered by Astro
Installation
npm i astro-reactive-form
Usage
---
import Form, { FormGroup } from "astro-reactive-form";
const form = new FormGroup([
{
name: 'first-name',
value: 'Ayo',
label: 'First Name',
},
{
name: 'last-name',
value: 'Ayco',
label: 'Last Name',
},
]);
---
<Form formGroup={form} />
Future Plans
Currently this only supports very basic form creation, but the goal of the project is ambitious:
- FormGroup class
- get(controlName: string) - returns the FormControl with matching name
- statusChanges - observable that emits the form status when it changes
- valueChanges - observable that emits the values of all controls when they change
- FormControl class
- setValue(value) - set the value of the control programmatically
- statusChanges - observable that emits the control status when it changes
- valueChanges - observable that emits the control value when it changes
- value - property that reflects the control value
... and so much more
All contributions are welcome. Let's make the fastest web form component powered by Astro