Skip to content

Commit 38328f5

Browse files
committed
improve readme
1 parent f537c71 commit 38328f5

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,21 @@
1212

1313
#### 🚀 Designed with simplicity and performance in mind
1414

15-
### Install
15+
## Installation
1616

1717
```sh
1818
npm install formite
1919
```
2020

21-
### Usage
21+
## Login form example
2222

2323
```tsx
24-
// LoginForm.tsx
25-
2624
import { component$, useStore} from "@builder.io/qwik";
2725
import Form, { ValidationStore } from "formite";
2826

2927
export const LoginForm = component$(() => {
3028

31-
// a store with inputs to validate with their validators
29+
// a store defining the inputs we need to validate along with their validators
3230
const validationStore: ValidationStore = useStore({
3331
email: {
3432
validator: /^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/, // or z.string().email()
@@ -39,7 +37,10 @@ export const LoginForm = component$(() => {
3937
});
4038

4139
return (
42-
<Form validationStore={validationStore} onSubmit$={console.log}>
40+
<Form
41+
validationStore={validationStore}
42+
onSubmit$={(formData)=>{/* send form data to server */}}>
43+
4344
{/* email */}
4445
<div>
4546
Email: <input name="email" />
@@ -64,3 +65,5 @@ export const LoginForm = component$(() => {
6465
);
6566
});
6667
```
68+
69+
### Have an issue? [Post it here](https://github.com/kumarasinghe/formite/issues)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "formite",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "A minimal and lightweight form library for Qwik",
55
"keywords": ["qwik", "form", "validation", "signup", "login", "lightweight", "minimal", "formite", "hook forms", "formik"],
66
"author": "Naveen Kumarasinghe <dndkumarasinghe@gmail.com>",

0 commit comments

Comments
 (0)