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

gform-react

v2.8.2

Published

Build generic forms with validations for React-based applications

Readme

Features

  • Lightweight
  • Tree‑shakable — import only what you use to keep bundles small
  • Minimal re-renders — updates only the fields that actually change
  • Native HTML constraint validation — full support for min, max, pattern, minLength, maxLength, required, and more
  • Custom Validations – add custom validation with any rules
  • Async Validations — run asynchronous rules for server-side checks
  • Supports Yup, Zod, and more – use any validation library you like
  • Deeply Nested Forms — structure forms however you like, across any number of components
  • Dynamic fields — add or remove fields at runtime without losing state
  • Native <form> actions — fully supports browser‑level form submission, including action, method, and HTTP navigation, with no JavaScript required
  • Next.js Server Actions support — works seamlessly with Server Actions through standard <form> submissions, with no special adapters or client‑side wiring
  • Accessibility‑friendly — automatically manages aria-required and aria-invalid
  • React Native support — works seamlessly across web and mobile

Documentation

Full documentation, examples, and API reference:

https://gform-react.onrender.com

QuickStart

import {GForm, GInput, GValidator, type GValidators} from "gform-react";

interface SignInForm {
  username: string;
  password: string;
}

const baseValidator = new GValidator().withRequiredMessage('this field is required');

const validators: GValidators<SignInForm> = {
  '*': baseValidator, // a default validator for all other fields in the form

  password: new GValidator(baseValidator)
          .withMinLengthMessage((input) => `${input.formKey} must contain atleast ${input.minLength} chars`),
};

const App: FC = () => {
    return (
            <GForm<SignInForm> className='some-class'
                               validators={validators}
                               onSubmit={(formState, e) => { //can be used with native `action` or with Next.js `server actions`
                                    e.preventDefault();
                                    console.log(formState);
                               }}>
                <GInput formKey='username'
                        required
                        element={(input, props) => <div>
                            <input {...props} placeholder='username'/>
                            {input.error && <small className="p-error">{input.errorText}</small>}
                        </div>}
                />
                <GInput formKey='password' 
                        type='password'
                        required
                        minLength={5}
                        element={(input, props) => <div>
                            <input {...props} placeholder='password'/>
                            {input.error && <small className="p-error">{input.errorText}</small>}
                        </div>}
                />
                <button>Submit</button>
            </GForm>
    );
};

Installation

npm:

npm install gform-react

yarn:

yarn add gform-react

Peer dependencies

react >=16.8.0, react-dom >=16.8.0 are peer dependencies

License

MIT © Tal
https://www.npmjs.com/package/gform-react