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

form-panfilov

v1.0.27

Published

web form

Downloads

36

Readme

Description

React component that processes a form, its events and elements.

Installation

npm i --save form-panfilov

Testing

For testing, a bunch of jest and the testing library is used. To run the tests, type the following command

npm test

or command to restart the tests after they are changed

npm test:watch

Example and development

In the rollup folder in the terminal, enter the following command to create a link to the local npm package.

npm link

In the same folder, you need to create a link to react and react-dom.

Link to react

npm link ..\defaultReact\node_modules\react

Link to react-dom

npm link ..\defaultReact\node_modules\react-dom

After that, go to the defaultReact folder and run the project with the command

npm link start

Using

Key component of the form

<Form
    data={defaultValue}
    onSubmit={(fields: AuthUserFormInterface) => {
        if (!fields.email.error && !fields.password.error) {
            dispatch(
                authRequestFunc({
                  email: fields.email.value,
                  password: fields.password.value,
                  signal: abortController.signal,
                }),
            );
        }
    }}
    className={classNames('d-flex flex-direction-column', {
        disabled: authRequest,
    })}
>
other form elements
</Form>

Props:

  • data - an array of objects that contain information about the form fields. Form fields must match the interface AuthUserFormInterface.
interface AuthUserFormInterface {
    [key: string]: {
        defaultValue: string;
        defaultError: boolean;
    };
}
  • onSubmit - a callback function that handles sending a function to the backend;;
  • classname - writes custom classes for the form tag;
  • buttonText - writes custom text for the submit button;

Wrapper component for form fields

<FormWrapper errors={errors} form={defaultValue}>
    fields form
<FormWrapper/>

Props:

  • form - see the data props in the Form component described earlier;
  • errors - an array of objects that contains information about errors in form fields. The array element must conform to the ErrorMessages interface.
interface ErrorMessages {
    field: string;
    message: string[];
}

Text box component

<Input
    rules={{ requiredInputRules, emailRules }}
    placeholder="Email"
    type="text"
/>

Props:

  • type - input type;
  • classNames - writes custom classes for the input tag;
  • placeholder - placeholder for text field;
  • rules - validation rules for the text field. For validation, it is necessary to create an object of rules according to which the text field will be validated. At this point in time, text fields are validated using the following interface RulesValidationInterface;
  • name - the name of the text box;
  • defaultValue - default value;
  • errorMessage - field validation error message;

The fields classNames, name, defaultValue, errorMessage are optional.