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

react-schema-form-wizard

v1.2.0

Published

A customizable React JSON Schema Form library with shadcn/ui components and multi-step support

Readme

React Schema Form Wizard

A customizable React library for JSON Schema-based forms with multi-step support and shadcn/ui components.

🚀 Features

  • JSON Schema-based Forms - Configure forms using JSON Schema
  • 🎯 Multi-step Forms - Native support for multi-step forms
  • 🎨 shadcn/ui Components - Modern and accessible interface
  • 🔧 Highly Customizable - Customizable themes and widgets
  • Robust Validation - Real-time and custom validation
  • 📱 Responsive - Works perfectly on desktop and mobile
  • 🌐 TypeScript - Full TypeScript support

📦 Installation

npm install react-schema-form-wizard
# or
yarn add react-schema-form-wizard
# or
pnpm add react-schema-form-wizard

Required Dependencies

The library requires some peer dependencies:

npm install react react-dom

Import Styles

Important: You need to import the CSS file for proper styling:

// Import the CSS at the top of your main file (App.js, index.js, or _app.js)
import 'react-schema-form-wizard/dist/index.css';

Or if using a CSS file:

/* In your main CSS file */
@import 'react-schema-form-wizard/dist/index.css';

🔧 Basic Usage

Simple Form

import {FormResult, FormJsonStructure, FormSchemaWizard } from 'react-schema-form-wizard';
import 'react-schema-form-wizard/dist/index.css'; // Don't forget the CSS!

const formSchema: FormJsonStructure = {
  id: 1,
  documentId: "simple-form",
  title: "Contact Form",
  description: "Fill in your contact details",
  isMultiStep: false,
  json_schema: {
    $id: "contact-form",
    type: "object",
    title: "Contact",
    required: ["name", "email"],
    properties: {
      name: {
        type: "string",
        title: "Full name",
        placeholder: "Enter your name"
      },
      email: {
        type: "string",
        title: "Email",
        placeholder: "Enter your email"
      },
      message: {
        type: "string",
        title: "Message",
        placeholder: "Your message"
      }
    }
  },
  createdAt: new Date().toISOString(),
  updatedAt: new Date().toISOString(),
  publishedAt: new Date().toISOString()
};

function App() {
  const handleSubmit = (result: FormResult) => {
    console.log('Form data:', result);
  };

  return (
    <div className="p-4">
      <FormSchemaWizard 
        formJson={formSchema} 
        onSubmit={handleSubmit}
      />
    </div>
  );
}

For Next.js: Add the CSS import to your main layout or _app.js:

// app/layout.tsx (App Router)
import 'react-schema-form-wizard/dist/index.css';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

Or create your own client wrapper:

// components/FormWrapper.tsx
'use client';

import { FormSchemaWizard } from 'react-schema-form-wizard';

export default function FormWrapper({ formJson, onSubmit }: { formJson: FormJsonStructure, onSubmit: Promise<void>}) {
  return <FormSchemaWizard formJson={formJson} onSubmit={onSubmit} />;
}

Multi-Step Form

import { FormResult, FormJsonStructure, FormSchemaWizard } from 'react-schema-form-wizard';

const multiStepFormSchema: FormJsonStructure = {
  id: 2,
  documentId: "multi-step-form",
  title: "Complete Registration",
  description: "Complete your registration in a few steps",
  isMultiStep: true,
  json_schema: {
    isMultiStep: true,
    steps: [
      {
        id: "step1",
        title: "Personal Information",
        schema: {
          type: "object",
          required: ["firstName", "lastName"],
          properties: {
            firstName: {
              id: "firstName",
              name: "firstName",
              type: "string",
              label: "First Name",
              required: true,
              placeholder: "Your first name"
            },
            lastName: {
              id: "lastName",
              name: "lastName", 
              type: "string",
              label: "Last Name",
              required: true,
              placeholder: "Your last name"
            }
          }
        }
      },
      {
        id: "step2",
        title: "Contact",
        schema: {
          type: "object",
          required: ["email"],
          properties: {
            email: {
              id: "email",
              name: "email",
              type: "string",
              label: "Email",
              required: true,
              placeholder: "[email protected]"
            },
            phone: {
              id: "phone",
              name: "phone",
              type: "string",
              label: "Phone",
              required: false,
              placeholder: "(11) 99999-9999"
            }
          }
        }
      }
    ]
  },
  createdAt: new Date().toISOString(),
  updatedAt: new Date().toISOString(),
  publishedAt: new Date().toISOString()
};

function App() {

  const handleSubmit = (result: FormResult) => {
    console.log('Form data:', result);
  };

  return (
    <div className="p-4">
      <FormSchemaWizard formJson={multiStepFormSchema} />
    </div>
  );
}

🎨 Customization

Custom Theme

import { FormSchemaWizard, rjsfShadcnTheme } from 'react-schema-form-wizard';

const customTheme = {
  ...rjsfShadcnTheme,
  widgets: {
    ...rjsfShadcnTheme.widgets,
    // Your custom widgets
  },
  templates: {
    ...rjsfShadcnTheme.templates,
    // Your custom templates
  }
};

function App() {
  return (
    <FormSchemaWizard 
      formJson={formSchema}
      customTheme={customTheme}
    />
  );
}

CSS Styles

The library uses Tailwind CSS. Make sure to include the necessary classes in your project or use a custom theme.

📋 API Props

FormSchemaWizardProps

| Prop | Type | Required | Description | |------|------|----------|-------------| | formJson | FormJsonStructure | ✅ | Form configuration | | onSubmit | (result: FormResult) => void | ❌ | Callback executed on submit | | className | string | ❌ | Additional CSS classes | | customTheme | any | ❌ | Custom theme |

FormJsonStructure

interface FormJsonStructure {
  id: number;
  documentId: string;
  title: string;
  description: string | null;
  isMultiStep: boolean;
  json_schema: SimpleFormSchema | MultiStepSchema;
  createdAt: string;
  updatedAt: string;
  publishedAt: string;
}

FormResult

interface FormResult {
  formInfo: {
    id: number;
    title: string;
    isMultiStep: boolean;
    submittedAt: string;
  };
  fields: Record<string, {
    name: string;
    value: unknown;
    type: string;
    title: string;
    required: boolean;
  }>;
}

🛠️ Development

Build the library

cd lib
npm install
npm run build

Linting

npm run lint
npm run lint:fix

Type checking

npm run type-check

📄 License

MIT © Hélio Fragão Fila

🤝 Contributing

Contributions are welcome! Please open an issue or pull request.

📧 Contact

  • Author: Hélio Fragão Fila
  • Email: [email protected]
  • GitHub: https://github.com/H3lio2f/react-schema-form-wizard

🔗 Useful Links