--- import Layout from '../../layouts/Layout.astro' import Footer from '../../components/Footer.astro' import Form, { type ControlConfig, FormGroup } from '@astro-reactive/form' import { Validators } from '@astro-reactive/validator' const simpleForm = new FormGroup([ { name: 'simple-text', label: 'Simple Text Control', }, { name: 'email', label: 'Email', value: 'invalid-email', validators: [Validators.email], }, ]) const name: ControlConfig[] = [ { name: 'first-name', value: 'Ayo', label: 'First Name', validators: [Validators.required], }, { name: 'last-name', label: 'Last Name', validators: [Validators.required], }, ] const characteristics: ControlConfig[] = [ { name: 'is-good-looking', type: 'radio', label: 'Is Good Looking?', value: 'checked', options: [ { value: 'checked', label: 'checked' }, { value: 'not checked', label: 'not checked' }, ], }, { name: 'required', label: 'Required Field', placeholder: 'but empty 😔', validators: [Validators.required], }, { name: 'is-awesome', type: 'checkbox', label: 'Is Awesome?', value: 'checked', }, ] const nameForm: FormGroup = new FormGroup(name, 'Name') const characteristicsForm: FormGroup = new FormGroup( characteristics, 'Characteristics' ) ---

Astro Reactive Form

Generate a dynamic form based on your data, and modify programatically

Simple single form group

Here's an example of a simple form with email validation

Multiple Form Groups

Here's a more complex example of a form with multiple fieldsets