From 38328f55b130aaae6cdbd0389d9412e2273bd154 Mon Sep 17 00:00:00 2001 From: Naveen Kumarasinghe Date: Mon, 29 May 2023 23:41:18 +0530 Subject: [PATCH] improve readme --- README.md | 15 +++++++++------ package.json | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9e3ec81..acdb368 100644 --- a/README.md +++ b/README.md @@ -12,23 +12,21 @@ #### 🚀 Designed with simplicity and performance in mind -### Install +## Installation ```sh npm install formite ``` -### Usage +## Login form example ```tsx -// LoginForm.tsx - import { component$, useStore} from "@builder.io/qwik"; import Form, { ValidationStore } from "formite"; export const LoginForm = component$(() => { - // a store with inputs to validate with their validators + // a store defining the inputs we need to validate along with their validators const validationStore: ValidationStore = useStore({ email: { validator: /^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/, // or z.string().email() @@ -39,7 +37,10 @@ export const LoginForm = component$(() => { }); return ( -
+ {/* send form data to server */}}> + {/* email */}
Email: @@ -64,3 +65,5 @@ export const LoginForm = component$(() => { ); }); ``` + +### Have an issue? [Post it here](https://github.com/kumarasinghe/formite/issues) \ No newline at end of file diff --git a/package.json b/package.json index f4417f4..5d87b8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formite", - "version": "1.0.1", + "version": "1.0.2", "description": "A minimal and lightweight form library for Qwik", "keywords": ["qwik", "form", "validation", "signup", "login", "lightweight", "minimal", "formite", "hook forms", "formik"], "author": "Naveen Kumarasinghe ",