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

the-react-form

v0.3.0

Published

React form component for generally usage.

Downloads

3

Readme

the-react-form

Simple form component with validation for general use.

Usage

The component takes several prop values. These are shown below.

  • formSettings -- Takes a object as a shown below. NOTE: Keys indicate form labels.

    Types: -- Default (text input) -- 'select' -- 'radio' -- 'textarea' -- 'datepicker' -- 'upload'

    const formObject = {
    	Name: {
    		value:  '',
    		placeholder:  'Enter your name',
    		required:  true,
    	},
    	Password: {
    		value:  '',
    		placeholder:  'Enter your password',
    		required:  true,
    		type:  'password'
    	},
    	'Select Gender': {
    		values: ['Male', 'Female', 'Other'],
    		value:  'Male',
    		placeholder:  'Select your gender',
    		type:  'select',
    		required:  true,
    	},
    	'User Type': {
    		value:  'Admin',
    		type:  'radio',
    		values: ['Admin', 'User'],
    		required:  true,
    	},
    	Note: {
    		value:  '',
    		type:  'textarea',
    		placeholder:  'Enter your note',
    		required:  true,
    		height:  '300px'
    	},
    	'Select Date': {
    		value:  '',
    		type:  'datepicker',
    		required:  true
    	},
    	'Upload CV': {
    		required: true,
    		type: 'upload',
    		value: ''
    	}
    }
  • onSubmit -- It is triggered by the call to action button, and if the form is valid, it is the triggered function. Returns the filled form values as a object.

{
    'Name': "Mert"
    'Note': "Hello world."
    'Password': "123456"
    'Select Date': M {$L:  'en',  $u:  undefined,  $d:  Wed Feb 07 2024 17:41:17 GMT+0300 (GMT+03:00),  $y:  2024,  $M:  1, …}
    'Select Gender': "Male"
    'User Type': "Admin",
	'Upload CV': "data:application/pdf;base64,JVBERi0xLjUKJb/3ov4K..."
}

NOTE: Date value returned as a 'moment' object.

  • CTAButtonTitle -- Sets the text of the call to action button. By default it takes the value 'Submit'.
  • inValidMessage -- Sets the message to be displayed in case the form is invalid. Default value; 'The fields shown are required! Please fill in.' is set to .
<TheForm  formSettings={formObject}  onSubmit={onSubmit}  CTAButtonTitle="Submit Form!"  />
const  onSubmit  = (form) => {

console.log('submitted', form);

// You can make API requests here with 'form'

}

NOTE: If you experience any problems or have any suggestions, I would be happy if you open a github issue. Thanks.