From 90e2ec6fb55c3166aaa203a98e0a6ff35d8062cd Mon Sep 17 00:00:00 2001 From: Ayo Date: Mon, 26 Sep 2022 11:18:15 +0200 Subject: [PATCH] docs: update readme --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e489da..b819f1c 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,36 @@ npm i astro-reactive-form --- import Form, { FormGroup } from "astro-reactive-form"; -const form = new FormGroup([ + +// example of a form control +const radio: FormControl = { + name: 'is-good-looking', + type: 'radio', + label: 'Is Good Looking?', + value: 'checked', + labelPosition: 'right', +} + +const form = new FormGroup([ // this is just an array of FormControl { name: 'first-name', value: 'Ayo', label: 'First Name', + }, { name: 'last-name', value: 'Ayco', label: 'Last Name', }, + { + name: 'is-awesome', + type: 'checkbox', + label: "Is Awesome?", + value: 'checked', + labelPosition: 'right', + }, + radio // the form control we declared earlier ]); ---