graneet-form
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

graneet-form

Documentation

Performant forms and wizard library for React

Features 🚀

  • Performant and easy to use
  • System of wizard integrated with integration of form
  • Small bundle size
  • Error handle
  • Value watching built-in

Install

pnpm add graneet-form
# or
yarn add graneet-form
# or
npm install graneet-form

#Usage

import { Field, useForm } from 'graneet-form';

function Input({ name }) {
  return (
    <Field
      name={name}
      render={({ value, onChange, onBlur, onFocus }, state) => {
        return <input value={value} onChange={onChange} onBlur={onBlur} onFocus={onFocus} />;
      }}
    />
  );
}

function App() {
  const form = useForm();

  const handleClick = () => form.getFormValues();

  return (
    <Form form={form}>
      <Input name="firstName" />
      <button onClick={handleClick} />
    </Form>
  );
}

Package Sidebar

Install

npm i graneet-form

Weekly Downloads

1,746

Version

2.0.0

License

MIT

Unpacked Size

437 kB

Total Files

87

Last publish

Collaborators

  • graneet