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

@avarock/react-form

v1.5.0

Published

A customizable React form library with modular input components for building flexible forms

Readme

@avarock/react-form

A lightweight, customizable React + TypeScript library for building dynamic forms with SCSS-based styling.

Installation

Install the package via npm:

npm i @avarock/react-form

Features

  • Pre-styled, customizable form and input components.
  • Supports both browser-based and in-built form validation.
  • Custom themes (light and dark).
  • Flexible styling with support for className and style props.

Usage

Here’s an example of how to use the components:

import {
  Form,
  InputText,
  InputTextAnimated,
  InputSelect,
  InputTextArea,
  InputCheckBox,
  InputRadio,
} from "@avarock/react-form";
import "@avarock/react-form/dist/styles.css";

function App() {
  function handleSubmit(formState: Record<string, any>) {
    console.log(formState);
  }

  return (
    <div>
      <Form
        style={{ gridTemplateColumns: "1fr 1fr", maxWidth: "40rem" }}
        onSubmit={handleSubmit}
        theme="light"
        HTMLValidate={false}
        showSubmitBtn={true}
      >
        <InputText
          label="Name"
          name="name"
          placeholder="Enter your name"
          required
        />
        <InputText
          label="Age"
          name="age"
          placeholder="Enter your age"
          type="number"
          required
        />
        <InputTextAnimated type="email" label="Email" name="email" required />
        <InputTextAnimated
          type="password"
          label="Password"
          name="password"
          required
        />
        <InputSelect
          label="City"
          name="city"
          options={[
            { label: "Jaipur", value: "jaipur" },
            { label: "Mumbai", value: "mumbai" },
            { label: "Hyderabad", value: "hyderabad" },
          ]}
          initialOptionLabel="Select City"
          required
        />
        <InputTextArea
          label="Bio"
          name="bio"
          placeholder="Enter your bio"
          maxLength={80}
          required
        />
        <InputCheckBox
          style={{ alignSelf: "end" }}
          label="Allow Cookies"
          name="isCookieEnabled"
        />
        <InputRadio
          name="gender"
          label="Gender"
          options={[
            { label: "Male", value: "male" },
            { label: "Female", value: "female" },
            { label: "Other", value: "other" },
          ]}
          required
        />
      </Form>
    </div>
  );
}

export default App;

Styling

  • Import the library styles:
    import "@avarock/react-form/dist/styles.css";
  • You can also use the className or style props to apply custom styles.

Reference

Form

  • Props:
    • style: Inline styles for custom layout.
    • onSubmit(formState: Record<string, any>): Callback function triggered on form submission with form data.
    • HTMLValidate: Enable browser-based validation (true) or use the library's validation (false).
      Note: Currently, library validation only supports required, type="email", and type="password".
    • showSubmitBtn: Show/hide the submit button.
    • theme: Choose between "light" and "dark" themes.
    • Custom submit button or other elements can be passed as children.

InputText

  • Props:
    • name (required): Register the field in the form.
    • label (required): Display field label.
    • type: "text" | "password" | "email" | "number". Default: "text".
    • togglePasswordVisibility: Show/hide toggle button for password visibility (if type="password").
    • Any valid HTMLInputElement attributes.

InputTextAnimated

  • Similar to InputText with the following differences:
    • No placeholder prop (uses animation instead).
    • Styles for transition and animation.

InputSelect

  • Props:
    • name (required): Register the field in the form.
    • label (required): Display field label.
    • options (required): Array of objects { label: string; value: string } to generate <option> elements.
    • initialOptionLabel: Placeholder for the dropdown (Default: "Select"). Becomes hidden on user toggle, if required is set.
    • Any valid HTMLSelectElement attributes.

InputTextArea

  • Props:
    • name (required): Register the field in the form.
    • label (required): Display field label.
    • maxLength: Sets the limit and also displays an overlay showing the number of characters typed.
    • Custom scrollbars for better UX.
    • Any valid HTMLTextareaElement attributes.

InputCheckBox

  • A custom <input type="checkbox" /> element.
  • Props:
    • name (required): Register the field in the form.
    • label (required): Display field label.
    • Any valid HTMLInputElement attributes, except type, which is set to "checkbox".

InputRadio

  • A group of <input type="radio" /> elements.
  • Props:
    • name (required): Register the field in the form.
    • label (required): Display field label.
    • options (required): Array of objects { label: string; value: string } to generate radio buttons.
    • Any valid HTMLInputElement attributes, except type (set to "radio") and value (derived from options).