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

pd-form-builder

v1.0.19

Published

### πŸš€ **Build Powerful Forms Effortlessly**

Readme

⚑️ Form Builder

πŸš€ Build Powerful Forms Effortlessly

Form Builder is a dynamic, reusable form engine that handles everything you need for form creation out of the box.

  • βœ… Build your form dynamically – Simply pass a JSON schema that defines the fields you want.
  • βœ… Automatic validations – Required fields, custom rules, and error handling included.
  • βœ… State management – Captures, updates, and exposes form state seamlessly.
  • βœ… Flexible input types – Supports text inputs, checkboxes, dropdowns, multi-selects, date pickers, and more.
  • βœ… Submit actions – Built-in support for form submission and integration with APIs.
  • βœ… UI rendering – Clean and customizable UI generated automatically from your schema.

πŸ“– View Documentation

✨ Form Builder

πŸ“ Build Forms with JSON

🎯 Why use Form Builder?
Stop writing repetitive form code. Simply pass a JSON schema and let Form Builder render, manage state, and handle changes for you.


⚑ Features

βœ… Build forms by just passing JSON
βœ… Handles state and change events automatically
βœ… Minimal setup with maximum flexibility
βœ… Customizable UI and component overrides (coming soon)


πŸ’» Installation

npm install pd-form-builder

## πŸ“Œ Example Usage: FormBuilderReference

The following example shows how to use the `FormBuilder` component with different field types, validation, and actions:

```tsx
import React, { useEffect, useState } from "react";
import FormBuilder from "./FormBuilder";

const FormBuilderReference: React.FC = () => {
  const [formData, setFormData] = useState({}); //Set your Form Data Type here.
  const [customErrors, setCustomErrors] = useState<string[]>([]);

  useEffect(() => {
    console.log(formData);
  }, [formData]);

  const fields = [
    {
      label: "Full Name",
      name: "full_name",
      type: "input-box",
      props: {
        label: "Full Name",
        placeholder: "Enter your full name",
        mandatory: true,
      },
    },
    {
      label: "Email",
      name: "email",
      type: "input-box",
      props: {
        label: "Email",
        placeholder: "Enter your email",
        keyboardType: "email-address",
        mandatory: true,
      },
    },
    {
      label: "Date of Birth",
      name: "dob",
      type: "datepicker",
      props: {
        label: "Date of Birth",
        placeholder: "Select date of birth",
        mandatory: true,
      },
    },
    {
      label: "Gender",
      name: "gender",
      type: "radio-input",
      props: {
        label: "Select Gender",
        options: [
          { label: "Male", value: "male" },
          { label: "Female", value: "female" },
        ],
        mandatory: true,
      },
    },
    {
      name: "volume",
      label: "Volume",
      type: "slider",
      sectionBreak: true,
      props: {
        label: "Volume",
        min: 0,
        max: 10,
        step: 1,
      },
    },
    {
      label: "Hobbies",
      name: "hobbies",
      type: "dropdown",
      sectionBreak: true,
      props: {
        label: "Select Hobbies",
        items: [
          { label: "Reading", value: "reading" },
          { label: "Music", value: "music" },
          { label: "Sports", value: "sports" },
        ],
      },
    },
    {
      name: "mobile-notifications",
      label: "Enable Mobile Notifications",
      type: "switch",
      sectionBreak: true,
      props: {
        label: "Enable Mobile Notifications",
      },
    },
    {
      name: "push-notifications",
      label: "Enable Push Notifications",
      type: "switch",
      props: {
        label: "Enable Push Notifications",
      },
    },
    {
      name: "web-notifications",
      label: "Enable Web Notifications",
      type: "switch",
      props: {
        label: "Enable Web Notifications",
      },
    },
    {
      name: "auto-update",
      label: "Enable Auto Update",
      type: "switch",
      props: {
        label: "Enable Auto Update",
      },
    },
    {
      label: "Skills",
      name: "skills",
      type: "multi-select-box",
      sectionBreak: true,
      props: {
        label: "Select Skills",
        items: [
          { label: "React", value: "react" },
          { label: "Node.js", value: "node" },
          { label: "Python", value: "python" },
        ],
      },
    },
  ];

  const handleSubmit = () => {
    console.log("Form submitted with data:", formData);
    alert("Form submitted successfully!");
  };

  const handleCancel = () => {
    console.log("Form cancelled");
  };

  return (
    <div style={{ padding: 20, marginBottom: 20 }}>
      <FormBuilder
        fields={fields}
        formData={formData}
        setFormData={setFormData}
        customErrors={customErrors}
        setCustomErrors={setCustomErrors}
        functions={{
          submit: { label: "Submit", function: handleSubmit },
          cancel: { label: "Cancel", function: handleCancel },
        }}
        inputColumns={2}
      />
    </div>
  );
};

export default FormBuilderReference;