Introduction
A simple form state manager for React.
Features
-
Simple APIs to use
-
Supports nested & array fields
-
Supports form validation (Works with any schema validation lib)
-
Render optimized
-
TypeScript Support
Installation
pnpm add @opentf/react-form
Usage
import { Form, Field } from '@opentf/react-form';
export default function App() {
const initialValues = {name: ''}
return (
<Form initialValues={initialValues} onSubmit={(values) => console.log(values)}>
<div>
<label>Label: </label>
<Field name="name" />
</div>
<button type="submit">Submit</button>
</Form>
);
}
Demo
⚡ by React Sandbox
Related
-
@opentf/react-state (opens in a new tab) - A global state manager for React.
-
@opentf/react-sandbox (opens in a new tab) - The CodeSandbox sandpack wrapper with additional features.
-
@opentf/react-node-repl (opens in a new tab) - The Node.js REPL in a React component.
-
@opentf/std (opens in a new tab) - An Extensive JavaScript Standard Library.