Skip to content

Commit

Permalink
docs: updte readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanga-Ganapathy committed Mar 14, 2024
1 parent e7eed83 commit e7fbc22
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 69 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-dodos-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@opentf/react-form': minor
---

Updated docs
36 changes: 6 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

</div>

> A simple form state management for React.
> A simple form state manager for React.
# [View Demo](https://react-form.pages.dev/#demo) | [Documentation](https://react-form.pages.dev/)
# [Live Demo](https://react-form.pages.dev/#demo) | [Documentation](https://react-form.pages.dev/)

## Features

- Simple APIs to use

- It supports nested & array fields
- Supports nested & array fields

- It supports form validation
- Supports form validation (Works with any schema validation lib)

- Render optimized

Expand Down Expand Up @@ -52,37 +52,13 @@ import { Form, Field } from '@opentf/react-form';
export default function App() {
return (
<Form
initialValues={{ field1: '', field2: '' }}
onSubmit={(values) => {
console.log(values);
}}
>
<Field name="field1" />
<button type="submit">Submit</button>
</Form>
);
}
```

## Usage (TypeScript)

```tsx
import { Form, Field } from '@opentf/react-form';

interface FormValues {
field1: string;
}

export default function App() {
const initialValues: FormValues = { field1: '' };

return (
<Form
initialValues={initialValues}
onSubmit={(values) => {
console.log(values);
}}
>
<Field name="field1" />
<Field name="field2" type="number" />
<button type="submit">Submit</button>
</Form>
);
Expand Down
12 changes: 6 additions & 6 deletions apps/website/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ import MUI from '!!raw-loader!@site/src/Demo/MUI';

# React Form

> A simple form state management for React.
> A simple form state manager for React.
## Features

- Simple API
- Simple APIs to use

- It supports nested & array fields
- Supports nested & array fields

- It supports form validation

- TypeScript support
- Supports form validation (Works with any schema validation lib)

- Render optimized

- TypeScript support

- <a href="https://bundlephobia.com/package/@opentf/react-form">Minified + GZip Size ~3KB</a>

## DEMO
Expand Down
36 changes: 6 additions & 30 deletions packages/react-form/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

</div>

> A simple form state management for React.
> A simple form state manager for React.
# [View Demo](https://react-form.pages.dev/#demo) | [Documentation](https://react-form.pages.dev/)
# [Live Demo](https://react-form.pages.dev/#demo) | [Documentation](https://react-form.pages.dev/)

## Features

- Simple APIs to use

- It supports nested & array fields
- Supports nested & array fields

- It supports form validation
- Supports form validation (Works with any schema validation lib)

- Render optimized

Expand Down Expand Up @@ -52,37 +52,13 @@ import { Form, Field } from '@opentf/react-form';
export default function App() {
return (
<Form
initialValues={{ field1: '', field2: '' }}
onSubmit={(values) => {
console.log(values);
}}
>
<Field name="field1" />
<button type="submit">Submit</button>
</Form>
);
}
```

## Usage (TypeScript)

```tsx
import { Form, Field } from '@opentf/react-form';

interface FormValues {
field1: string;
}

export default function App() {
const initialValues: FormValues = { field1: '' };

return (
<Form
initialValues={initialValues}
onSubmit={(values) => {
console.log(values);
}}
>
<Field name="field1" />
<Field name="field2" type="number" />
<button type="submit">Submit</button>
</Form>
);
Expand Down
6 changes: 4 additions & 2 deletions packages/react-form/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opentf/react-form",
"version": "0.21.1",
"description": "A simple form state management for React.",
"description": "A simple form state manager for React.",
"homepage": "https://react-form.pages.dev/",
"keywords": [
"react",
Expand All @@ -13,7 +13,9 @@
"zod",
"material-ui",
"mui",
"chakra-ui"
"chakra-ui",
"schema",
"json"
],
"type": "module",
"main": "dist/index.cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-form/tsup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export default defineConfig({
format: ['cjs', 'esm'],
dts: true,
minify: true,
name: 'utils',
name: 'reactForm',
});

0 comments on commit e7fbc22

Please sign in to comment.