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

falcon-form

v1.0.5

Published

Form handling and error validation in React hooks.

Downloads

9

Readme

falcon-form

Form handling and error validation in React hooks.

NPM JavaScript Style Guide npm npm bundle size

Install

npm install --save falcon-form

Demo

Codesandbox here

Features

  • No Wrapper | No HOC | Just KISS.
  • Your design, our logics.
  • Specific message for custom conditionals.
  • React-native support.
  • Tiny bundle with no dependencies.
  • native HTML support.

Usage

import React, { useState } from "react";
import falconForm, { isRequired, isEmail, checkboxHelper } from "falcon-form";

var renderCount = 0;

const App = () => {
  let [formInitialValues] = useState({
    email: "",
    name: "",
    department: []
  }); // getInitialValues, use setFormInitialValues to set data from API

  const formSubmitAction = values => {
    console.log("Form submitted", values);
  }; // declare submit success action

  const fieldValidators = {
    email: [isRequired, isEmail],
    name: [isRequired]
  }; // declare field validators

  const { values, errors, fieldChange, formSubmit } = falconForm(
    formInitialValues,
    formSubmitAction,
    fieldValidators
  );
  // pass initial values, submit actions, field validators
  // use values, errors and field handlers in form

  renderCount += 1;
  return (
    <div>
      <h4>Render count : {renderCount}</h4>
      <form onSubmit={formSubmit}>
        Name:
        <br />
        <input
          type="text"
          name="name"
          onChange={fieldChange}
          value={values.name}
        />
        {errors.name}
        <br />
        Email:
        <br />
        <input
          type="email"
          name="email"
          onChange={fieldChange}
          value={values.email}
        />
        {errors.email}
        <br />
        <br />
        <input
          type="checkbox"
          name="department"
          id="ece"
          value="ece"
          checked={checkboxHelper(values.department, "ece")}
          onChange={fieldChange}
        /> ECE
        <input
          type="checkbox"
          name="department"
          id="cse"
          value="cse"
          checked={checkboxHelper(values.department, "cse")}
          // checkboxHelper equivalent to values.department.includes('ece'), with single checkbox support
          onChange={fieldChange}
        />{" "}
        CSE
        <input type="submit" value="Submit" />
      </form>
    </div>
  );
};

export default App;

Create custom validations

import { customValidation } from "falcon-form";

// create custom validation function
// all form values available as second param
const min3CharRule = value => value.length < 3;

const stringMin3Char = customValidation(
  min3CharRule,
  "Minimum 3 letters required"
);

// Pass these validations to fieldValidators

License

MIT © varunthefalcon