🚧: This new docs site is WIP!
Introduction

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

Related