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

d-dynamic-form-builder-react

v0.2.1

Published

## Description The Dynamic "d-dynamic-form-builder-react" is a container for dynamic forms that allows rendering and handling different forms with custom input fields.

Downloads

57

Readme

Component for dynamic forms with React + Formik

Description

The Dynamic "d-dynamic-form-builder-react" is a container for dynamic forms that allows rendering and handling different forms with custom input fields.

Installation

npm i d-dynamic-form-builder-react

Example

Typescript

import { DynamicFormContainer, Form } from 'd-dynamic-form-builder-react';
import { InputProps } from 'd-dynamic-form-builder-react/dist/interfaces/interfaces';

const App = () => {

  const forms: { [x: string]: InputProps[] } = {
    login: [
      {
        type: "text",
        name: "name",
        label: "Full Name",
        placeholder: "Full Name",
        value: "",
        validations: [
          {
            type: "required",
            message: "Full Name is required",
          },
        ],
      },
      {
        type: "email",
        name: "email",
        label: "E-mail",
        placeholder: "E-mail",
        value: "",
        validations: [
          {
            type: "required",
            message: "Email is required",
          },
          {
            type: "isEmail",
            message: "Email no valid",
          },
        ],
      },
      {
        type: "password",
        name: "password",
        label: "Password",
        placeholder: "*******",
        value: "",
        validations: [
          {
            type: "required",
            message: "Password is required",
          },
        ],
      },
    ],
  };

  return (
    <>
      <DynamicFormContainer
        formSchema={forms}
        formTitle={"Form"}
      >
        {(values) => (
          <>
            <Form />
          </>
        )}
      </DynamicFormContainer>
    </>
  );
};

Props

  1. formSchema (array) [required]: An array of objects that define the form fields. Each object should have the following properties:
  • type (string): The type of the field. Valid types are text, number, select, and checkbox.
  • name (string): The name of the field.
  • value (string | number | boolean | string[] | DefaultJSON[]): The initial value for the field.
  • validations (array): An array of validation rules for the field.
  • placeholder (string): The placeholder text for the field.
  • typeValue (string | boolean | array | date): The type of the field value.
  • label (string): The label for the field.
  • options (array): An array of options for the select field.
  • fields (array): An array of nested form fields.
  1. formTitle (string) [required]: The title of the form.
  2. className (string) [optional]: The CSS class name for the form container.
  3. onSubmit (function) [optional]: A function that is called when the form is submitted. The function will receive an object with the form data as the only argument.
  4. initialformdata (object) [optional] The initial values for the form fields.

| Property | Type | Description | | ------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | type | "text" | "textarea" | "email" | "password" | "radio-group" | "select" | "checkbox" | "checkbox-group" | "field-array" | The type of the input field. | | name | string | The name of the input field. | | value | string | number | boolean | string[] | DefaultJSON[] | The value of the input field. | | validations | Validation[] | (Optional) An array of validation rules for the input field. | | placeholder? | string | (Optional) The placeholder text for the input field. | | typeValue? | "string" | "boolean" | "array" | (Optional) The type of the value property. | | label? | string | (Optional) The label for the input field. | | options? | Opt[] | (Optional) An array of options for select or radio-group input fields. | | fields? | Fields[] | (Optional) An array of fields for field-array input type. Each field is of type Fields which has properties similar to InputProps. |

| Interface | Properties | Description | | --- | --- | --- | | Opt | - value: string | number- desc: string | Represents an option.- value: The value of the option.- desc: The description of the option. | | Fields | - type: "text"- name: string- label: string- placeholder?: string | Represents a field.- type: The type of the field.- name: The name of the field.- label: The label of the field.- placeholder?: (Optional) The placeholder text for the field. | | Validation | - type: "required" | "isEmail" | "minLength" | "isTrue" | "maxLength" | "matches" | "isUrl" | "maxDate" | "minDate"- value?: string | number | boolean | RegExp | Date- message: string | Represents a validation rule for a field.- type: The type of validation.- value?: (Optional) The value for the validation.- message: The validation error message. | | DefaultJSON | { [key: string]: any } | Represents a JSON object with any value types for its properties. |

h1 h2 h3 h4 h5 h6

  • type (required): The type of the heading. Possible values: "h1", "h2", "h3", "h4", "h5", "h6"
  • name (required): The name of the heading.
  • value (required): The value of the heading.

text

  • type (required): The type of the input field. Value: "text"
  • name (required): The name of the input field.
  • value (required): The default value of the input field.
  • label (optional): The label for the input field.
  • placeholder (optional): The placeholder text for the input field.
  • validations (optional): An array of validation rules for the input field. Possible validation types: isEmail, isUrl, minLength, maxLength, matches, required

password

  • type (required): The type of the input field. Value: "password"
  • name (required): The name of the input field.
  • value (required): The default value of the input field.
  • label (optional): The label for the input field.
  • validations (optional): An array of validation rules for the input field. Possible validation types: minLength, maxLength, matches, required

textarea

  • type (required): The type of the input field. Value: "textarea"
  • name (required): The name of the input field.
  • value (required): The default value of the input field.
  • label (optional): The label for the input field.
  • validations (optional): An array of validation rules for the input field. Possible validation types: minLength, maxLength, required

color

  • type (required): The type of the input field. Value: "color"
  • name (required): The name of the input field.
  • value (required): The default value of the input field. ("#000000") Important!
  • label (optional): The label for the input field.

radio-group

  • type (required): The type of the input field. Value: "radio-group"
  • name (required): The name of the input field.
  • value (required): The default selected value of the radio group.
  • options (required): An array of options for the radio group input field. Each option should have a value and desc.

select

  • type (required): The type of the input field. Value: "select"
  • name (required): The name of the input field.
  • value (required): The default selected value of the select field.
  • label (optional): The label for the input field.
  • options (required): An array of options for the select input field. Each option should have a value and desc.
  • validations (optional): An array of validation rules for the input field. Possible validation types: required, minLength, maxLength

checkbox

  • type (required): The type of the input field. Value: "checkbox"
  • name (required): The name of the input field.
  • typeValue (optional): The type of the value property.
  • value (required): The default selected value of the radio group. Possible values: True, False
  • label (optional): The label for the input field.
  • value (required): The default value of the checkbox.
  • validations (optional): An array of validation rules for the input field. Possible validation types: isTrue

date

  • type (required): The type of the input field. Value: "date"
  • name (required): The name of the input field.
  • label (optional): The label for the input field.
  • value (required): The default value of the date field.
  • typeValue (optional): The type of the value property.
  • validations (optional): An array of validation rules for the input field.
  • Possible validation types: maxDate, minDate, required

checkbox-group

  • type (required): The type of the input field. Value: "checkbox-group"
  • name (required): The name of the input field.
  • label (optional): The label for the input field.
  • value (required): The default value of the checkbox group, represented as an array.
  • typeValue (optional): The type of the value property.
  • options (required): An array of options for the checkbox group input field. Each option should have a value and desc.
  • validations (optional): An array of validation rules for the input field. Possible validation types: minLength, maxLength, required