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

enforma

v0.1.1

Published

Healthy forms for React — declare your fields, enforma handles the rest

Readme

enforma

Healthy forms for React. Write only your business logic — enforma handles the rest.

Why Enforma

Only write what's yours. No state management, no touched/error tracking, no blur handlers. Declare your fields, validations, and submit logic — enforma handles the plumbing.

Obvious markup. A single <TextInput> renders the wrapper, label, input, error message, description, and aria — exactly as your UI library expects.

Your form logic doesn't change when your UI does. Switch to a different component library later — your form code is untouched.

Installation

npm install enforma

Requires React 18+. Enforma has no UI of its own — you need a component adapter to render fields. See enforma-mui for the Material UI adapter.

Setup

Register a component adapter once before rendering any forms, typically in your app entry point:

import { registerComponents } from 'enforma';
import muiComponents from 'enforma-mui';

registerComponents(muiComponents, { variant: 'outlined' });

Usage

import Enforma from 'enforma';

export function CheckoutForm() {
  return (
    <Enforma.Form
      onSubmit={(values) => fetch('/api/order', { method: 'POST', body: JSON.stringify(values) })}
    >
      <Enforma.Select bind="method" label="Delivery method">
        <Enforma.Select.Option value="delivery" label="Delivery" />
        <Enforma.Select.Option value="pickup" label="Pickup in store" />
      </Enforma.Select>
      <Enforma.TextInput
        bind="address"
        label="Delivery address"
        disabled={({ method }) => method !== 'delivery'}
        validate={(value, { method }) =>
          method === 'delivery' && !value ? 'Address is required' : null
        }
      />
      <Enforma.Submit>Place order</Enforma.Submit>
    </Enforma.Form>
  );
}

Submit button

Use submitDisabled to control when the submit button is enabled based on form state:

import Enforma, { submitDisabled } from 'enforma';

<Enforma.Submit disabled={submitDisabled((_, __, { formValid }) => !formValid)}>
  Place order
</Enforma.Submit>

Features

  • High performance — each field re-renders only when its own value changes (powered by useSyncExternalStore)
  • Reactive attributesdisabled, label, placeholder accept static values or functions that respond to form state
  • Cross-field validation — validators receive the full form state
  • Hierarchical scopes — nest sections with automatic path prefixing via Enforma.Scope
  • Dynamic lists — field arrays with Enforma.List
  • UI library agnostic — swap your component library without touching form logic

Advanced

For power users building custom components or integrations.

Use useFieldProps to build components that integrate with the form store:

import { useFieldProps } from 'enforma';

function MyInput({ bind, label }: { bind: string; label: string }) {
  const { value, setValue, error } = useFieldProps({ bind, label });
  return <input value={value} onChange={(e) => setValue(e.target.value)} />;
}

CJS usage

When using CommonJS require, access the default export via .default:

const { default: Enforma, registerComponents } = require('enforma');

License

MIT