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

v2.9.96

Published

AutoForma is a headless dynamic form builder based on React Hook Form

Downloads

1,504

Readme

AutoForma

AutoForma is a headless dynamic form engine built on top of React Hook Form. It allows you to build forms from a schema, handle dynamic field behavior, and manage form state without being tied to any specific UI framework.

AutoForma focuses on form logic, while leaving UI rendering fully in your control


Features

  • Headless by design — no UI framework required
  • Schema-driven forms — build forms from a single schema definition
  • Powered by React Hook Form — fast, performant, and reliable
  • Dynamic field behavior — fields can react to other field values
  • Read-only — easily lock forms or fields
  • Object & array support — nested and repeatable fields
  • Immutable & predictable — no hidden side effects
  • UI-agnostic — works with any design system or custom components
  • Extensible — easy to add custom logic or renderers

Installation

AutoForma is currently distributed via npm only.

npm install autoforma

AutoForma is built and tested with React 19 and React Hook Form.

Quick Start

const Form = () => {
  const schema = useMemo<Schema>(() => [
    {
      type: "text",
      name: "firstName",
      label: "First Name"
    },
    {
      type: "text",
      name: "lastName",
      label: "Last Name"
    },
    {
      type: "select",
      name: "gender",
       label: "Gender",
       options: [
        {label: "Male", value: "male"},
        {label: "Female", value: "female"}
       ],
       initialValue: "male"
    }
  ],[])
  
  const handleSubmit = useCallback((values:FormValues) => {
    console.log("values: " , values)
  },[])

  return (
    <AutoForm
      schema={schema}
      onSubmit={handleSubmit}
    />
  )
}

Field Types

AutoForma determines how each field is rendered using a string-based type property.

Supported Field Types

AutoForma supports the following built-in field types:

  • text
  • number
  • checkbox
  • select
  • date
  • datetime-local
  • time
  • array
  • object

AutoForm Props

| Prop | Type | Required | Description | Example | |-----|------|----------|-------------|---------| | schema | Schema | ✅ Yes | Form schema definition used to build the form dynamically | schema={[{ type: "text", name: "title", label: "Title" }]} | | onSubmit | (values: FormValues) => void | ✅ Yes | Callback triggered when the form is submitted | onSubmit={(values) => console.log(values)} | | layout | "vertical" \| "horizontal" \| "custom" | ❌ No | Layout strategy for rendering fields | layout="vertical" | | uiConfig | UiConfig | ❌ No | Configure custom field renderers by name or type | uiConfig={{renderersByName: {firstName: ({fieldSchema, register}) => {return <div>firstName</div>}}}} | | updateFieldSchema | UpdateFieldSchema | ❌ No | Dynamically update field schema based on form values | updateFieldSchema={{firstName: (path, fieldSchema, values) => {if(values.lastName === "TEST"){return {...fieldSchema,label: "FIRST NAME"}}return fieldSchema}}} | | values | () => FormValues \| Promise<FormValues> | ❌ No | Async or sync function to load initial form values | values={() => fetchData()} | | hideSubmit | boolean | ❌ No | Hide the default submit button | hideSubmit | | onDirtyChange | (isDirty: boolean) => void | ❌ No | Triggered when form dirty state changes | onDirtyChange={(dirty) => setDirty(dirty)} | | onValuesChange | (values: FormValues) => void | ❌ No | Triggered whenever form values change | onValuesChange={(v) => console.log(v)} | | resolver | Resolver<FormValues> | ❌ No | Validation resolver (e.g. Zod, Yup) | resolver={zodResolver(schema)} | | readonly | boolean | ❌ No | Make the entire form read-only | readonly |


AutoFormRef API

| Method | Signature | Description | |------|-----------|-------------| | submit | () => void | Programmatically submit the form | | setValue | (name: string, value: any) => void | Set a field value | | getValues | () => FormValues | Get all form values | | reset | (values: FormValues) => void | Reset form with new values |


Documentation

Storybook: https://sajinael98.github.io/AutoForma


License

MIT