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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@etherisc/react-json-form-builder

v0.1.9

Published

A React component for building forms using JSON Schema with Tailwind CSS styling

Downloads

702

Readme

React JSON Form Builder

A React component library for building beautiful forms using JSON Schema with Tailwind CSS styling.

Features

  • 🎨 Beautiful, responsive forms with Tailwind CSS
  • 📝 JSON Schema validation using @rjsf/validator-ajv8
  • 🎯 Customizable form layouts with UI Schema
  • 🔧 Rich form controls (text, email, number, date, select, etc.)
  • 🎛️ Custom button support
  • 🎭 Flexible styling options

Installation

npm install @etherisc/react-json-form-builder

Make sure you have the peer dependencies installed:

npm install react react-dom tailwindcss

Usage

  1. Import the FormBuilder component:
import { FormBuilder } from '@etherisc/react-json-form-builder';
  1. Use it in your React component:
function MyForm() {
  const schema = {
    type: 'object',
    properties: {
      firstName: { type: 'string', title: 'First Name' },
      email: { type: 'string', format: 'email', title: 'Email' }
    },
    required: ['firstName', 'email']
  };

  const uiSchema = {
    'ui:options': {
      columns: 2 // Display fields in 2 columns
    }
  };

  const handleSubmit = ({ formData }) => {
    console.log('Form submitted:', formData);
  };

  return (
    <FormBuilder
      schema={schema}
      uiSchema={uiSchema}
      onSubmit={handleSubmit}
      // Optional custom buttons
      customButtons={[
        {
          text: 'Cancel',
          onClick: () => console.log('Cancelled'),
          className: 'bg-gray-500 hover:bg-gray-600 text-white font-bold py-2 px-4 rounded'
        }
      ]}
    />
  );
}

Props

| Prop | Type | Description | |------|------|-------------| | schema | object | JSON Schema object defining the form structure | | uiSchema | object | UI Schema for customizing layout and appearance | | formData | object | Initial form data | | onChange | function | Callback when form values change | | onSubmit | function | Callback when form is submitted | | onError | function | Callback when validation errors occur | | buttons | object | Customize default buttons (submit) | | customButtons | array | Add additional buttons to the form | | className | string | Additional CSS classes for the form | | showErrorList | false | "top" | "bottom" | Whether and where to show validation errors | | noHtml5Validate | boolean | Whether to disable HTML5 validation |

Customizing Buttons

You can customize the submit button or hide it completely:

// Custom submit button text and style
<FormBuilder
  schema={schema}
  buttons={{
    submit: {
      text: 'Save',
      className: 'bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded'
    }
  }}
/>

// Hide the submit button
<FormBuilder
  schema={schema}
  buttons={{ submit: null }}
/>

Error Handling

You can control how validation errors are displayed:

// Show errors at the top of the form
<FormBuilder
  schema={schema}
  showErrorList="top"
/>

// Show errors at the bottom of the form
<FormBuilder
  schema={schema}
  showErrorList="bottom"
/>

// Don't show error list
<FormBuilder
  schema={schema}
  showErrorList={false}
/>

UI Schema Options

The UI Schema supports various options for customizing the form layout:

const uiSchema = {
  'ui:options': {
    columns: 2 // Number of columns in the form grid
  },
  'ui:order': ['field1', 'field2'], // Custom field order
  fieldName: {
    'ui:widget': 'textarea', // Custom widget for a field
    'ui:options': {
      rows: 5 // Widget-specific options
    }
  }
};

Development

This project follows the GitFlow branching model:

Branches

  • main - Production releases
  • develop - Development branch, source for feature branches
  • feature/* - New features
  • bugfix/* - Bug fixes
  • release/* - Release preparation
  • hotfix/* - Urgent fixes for production

Development Workflow

  1. Create a feature branch from develop:

    git checkout -b feature/your-feature develop
  2. Make your changes and commit using conventional commits:

    git commit -m "feat: add new feature"
    git commit -m "fix: resolve issue"
  3. Push your feature branch:

    git push origin feature/your-feature
  4. Create a Pull Request to merge into develop

  5. After review and approval, merge using squash merge

Release Process

  1. Create a release branch:

    git checkout -b release/1.0.0 develop
  2. Version bump and final testing

  3. Merge into main AND develop:

    git checkout main
    git merge --no-ff release/1.0.0
    git tag -a v1.0.0
    git checkout develop
    git merge --no-ff release/1.0.0

Styling

The library uses Tailwind CSS for styling. You can customize the appearance by:

  1. Overriding the default classes through the className prop
  2. Customizing the Tailwind configuration
  3. Using custom CSS classes in your UI Schema

Contributing

Contributions are welcome! Please follow our development workflow and submit your Pull Requests against the develop branch.

License

MIT