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

react-dynoform

v4.0.1

Published

JSON-based Dynamic Form Builder for React and React Native

Readme

🧩 DynamicForm – JSON-based Dynamic Form Builder for React

A flexible and extensible form-rendering React component powered by a JSON configuration. Built with TypeScript and Material UI, it supports nested fields, conditional rendering, and dynamic data loading.

⚙️ Built with React, TypeScript, and MUI (v5)
📦 Ideal for internal tools, admin panels, and dashboards


📦 Installation

npm install react-dynoform
# or
yarn add react-dynoform

🚀 Usage

import React from 'react';
import DynamicForm, { FormField } from 'react-dynoform';

const formFields: FormField[] = [
  {
    key: 'name',
    label: 'Name',
    type: 'text',
    required: true,
  },
  {
    key: 'subscribe',
    label: 'Subscribe to newsletter',
    type: 'checkbox',
  },
  {
    key: 'dob',
    label: 'Date of Birth',
    type: 'date',
  },
  {
    key: 'gender',
    label: 'Gender',
    type: 'radio',
    options: [
      { label: 'Male', value: 'male' },
      { label: 'Female', value: 'female' },
    ],
  },
];

export default function App() {
  return <DynamicForm fields={formFields} onSubmit={(data) => console.log('Submitted:', data)} />;
}

🛠 Features

  • ✅ Supports text, select, checkbox, radio, date, array, hidden
  • 📚 Nested forms (type: 'array') with collapsible sections
  • 🎯 Conditional rendering via dependsOn and showIf
  • 🔄 Bi-directional data mapping (mapTo, mapFrom, doNotMap)
  • 🔐 Full support for validation and controlled components
  • 🧪 Type-safe props with TypeScript

📘 FormField Schema

interface FormField {
  key: string;
  label: string;
  type?: 'text' | 'checkbox' | 'radio' | 'select' | 'hidden' | 'date' | 'array';
  nestedFields?: FormField[];
  options?:
    | { label: string; value: string }[]
    | ((formData: Record<string, any>) => { label: string; value: string }[]);
  defaultValue?: any;
  disabled?: boolean;
  required?: boolean;
  dependsOn?: string;
  showIf?: string; // "*" for any value, or comma-separated values
  mapTo?: string;
  doNotMap?: boolean;
  mapFrom?: string;
  valueType?: 'string' | 'number' | 'boolean' | 'date' | 'json' | 'jsonString' | 'array';
}

📤 Props

| Prop | Type | Description | | -------------------- | ------------------------------------- | ----------------------------- | | fields | FormField[] | Configuration array | | disabled? | boolean | Disables all inputs | | selectedValues? | Record<string, any> | Pre-filled values | | submitButtonLabel? | string | Custom submit label | | hideSubmit? | boolean | Hide the submit button | | onChange? | (data: Record<string, any>) => void | Called on any change | | onSubmit? | (data: Record<string, any>) => void | Called on submit | | onRemove? | (data: Record<string, any>) => void | Called when delete is clicked |


🧩 Supported Field Types

  • text: Single-line text input
  • checkbox: Boolean checkbox
  • radio: Select one from multiple options
  • select: Dropdown with options
  • date: MUI-compatible date picker
  • hidden: Hidden input for internal values
  • array: Nested and repeatable field sets

🔁 Conditional Display Logic

You can make fields appear based on another field's value using:

  • dependsOn: key of the controlling field
  • showIf: comma-separated list of values to match (* = any value)

Example:

{
  key: "state",
  label: "State",
  type: "text",
  dependsOn: "country",
  showIf: "USA,Canada"
}

🧪 Development

Clone locally:

git clone https://github.com/prashanth0926/react-dynoform.git
cd react-dynoform
npm install

Build for production:

npm run build

Run demo:

  • web
cd web
npm install
npm run dev
  • mobile
cd mobile
npm install
npm start

📜 License

MIT © 2025 Prashanth Molakala