npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

autoforma-react

v1.1.0

Published

Schema-driven React form generator built on React Hook Form with TypeScript, validation, dynamic schemas, custom renderers, custom field types, object fields, and array fields.

Readme

AutoForma React

AutoForma React is a schema-driven form generator built on top of React Hook Form.

It helps developers build dynamic, reusable, and maintainable React forms using TypeScript schemas instead of manually creating every field, validation rule, and form interaction.

Documentation

Interactive Storybook documentation:

https://sajinael98.github.io/autoforma-react


Installation

npm install autoforma-react react-hook-form

Peer Dependencies

react >= 18
react-dom >= 18
react-hook-form >= 7

Quick Example

import { FormGenerator } from "autoforma-react";

export default function App() {
  return (
    <FormGenerator
      schema={[
        {
          type: "text",
          name: "firstName",
          label: "First Name",
        },
        {
          type: "select",
          name: "status",
          label: "Status",
          options: [
            { label: "Active", value: "ACTIVE" },
            { label: "Inactive", value: "INACTIVE" },
          ],
        },
      ]}
      onSubmit={(values) => {
        console.log(values);
      }}
    />
  );
}

Features

  • Schema-based form rendering
  • Built-in field types
  • Select fields
  • Nested object fields
  • Array fields
  • Custom renderers
  • Custom field types
  • Validation hooks
  • Field change handlers
  • Dynamic schema updates
  • Dirty state tracking
  • React Hook Form integration
  • TypeScript support

Built-in Field Types

"text";
"number";
"checkbox";
"date";
"datetime";
"time";
"select";
"object";
"array";

Validation Example

<FormGenerator
  schema={[
    {
      type: "text",
      name: "email",
      label: "Email",
    },
  ]}
  validate={{
    email: ({ value }) => {
      if (!value) return "Email is required";

      if (!String(value).includes("@")) {
        return "Invalid email address";
      }

      return undefined;
    },
  }}
  onSubmit={(values) => {
    console.log(values);
  }}
/>

Custom Field Type Example

import { Controller, FormGenerator } from "autoforma-react";

<FormGenerator
  schema={[
    {
      type: "positive",
      name: "amount",
      label: "Amount",
      initialValue: 10,
    },
  ]}
  uiConfig={{
    renderersByType: {
      positive: ({ control, fieldSchema }) => (
        <Controller
          name={fieldSchema.name}
          control={control}
          render={({ field }) => <input {...field} type="number" min={0} />}
        />
      ),
    },
  }}
  onSubmit={(values) => {
    console.log(values);
  }}
/>;

Local Development

Install dependencies:

npm install

Run Storybook:

npm run storybook

Build the library:

npm run build

Build Storybook:

npm run build-storybook

License

This project is source-available.

You may use the software for evaluation, learning, and testing purposes.

Modification, redistribution, commercial use, publishing modified versions, or creating derivative works requires prior written permission from the author.

See the LICENSE file for full details.


Author

Saji Nael