Presenting a remarkable React Form Wizard Component equipped with validation and a progress bar

Presenting a remarkable React Form Wizard Component equipped with validation and a progress bar:

Cutting-edge React Form Wizard: Seamlessly Navigate Forms with Validation and Progress Tracking


React Form Wizard Component

A react form wizard component with validation and progress bar with no external dependencies which simplifies tab wizard management.

View Demo View Github

Installation

To install the package, you can use npm or yarn:

npm install react-form-wizard-component

Bash

or

yarn add react-form-wizard-component

Bash

Usage

Import the FormWizard component and use it in your React application:

import FormWizard from "react-form-wizard-component";
import "react-form-wizard-component/dist/style.css";

function App() {
  const handleComplete = () => {
    console.log("Form completed!");
    // Handle form completion logic here
  };
  const tabChanged = ({
    prevIndex,
    nextIndex,
  }: {
    prevIndex: number;
    nextIndex: number;
  }) => {
    console.log("prevIndex", prevIndex);
    console.log("nextIndex", nextIndex);
  };

  return (
    <>
      <FormWizard
        shape="circle"
        color="#e74c3c"
        onComplete={handleComplete}
        onTabChange={tabChanged}
      >
        <FormWizard.TabContent title="Personal details" icon="ti-user">
          {/* Add your form inputs and components for the frst step */}
          <h1>First Tab</h1>
          <p>Some content for the first tab</p>
        </FormWizard.TabContent>
        <FormWizard.TabContent title="Additional Info" icon="ti-settings">
          <h1>Second Tab</h1>
          <p>Some content for the second tab</p>
        </FormWizard.TabContent>
        <FormWizard.TabContent title="Last step" icon="ti-check">
          <h1>Last Tab</h1>
          <p>Some content for the last tab</p>
        </FormWizard.TabContent>
      </FormWizard>
      {/* add style */}
      <style>{`
        @import url("https://cdn.jsdelivr.net/gh/lykmapipo/themify-icons@0.1.2/css/themify-icons.css");
      `}</style>
    </>
  );
}

export default App;

React TSX

Props

The FormWizard component accepts the following props:

  • title (optional): The title of the form wizard. It can be a string or a ReactNode.
  • subtitle (optional): The subtitle or description of the form wizard.
  • shape (optional): The shape of the wizard tabs (e.g., "circle", "square").
  • color (optional): The color of the wizard tabs and progress bar.
  • children (required): The content of the form wizard, including the form tabs and their content.
  • nextButtonText (optional): The text for the "Next" button.
  • backButtonText (optional): The text for the "Back" button.
  • finishButtonText (optional): The text for the "Finish" button.
  • stepSize (optional): The size of the steps (e.g., "xs", "sm", "md", "lg").
  • layout (optional): The layout of the form wizard (e.g., "horizontal", "vertical").
  • onComplete (optional): A callback function to be called when the form wizard is completed.
  • onTabChange (optional): A callback function to be called when the active tab is changed.

The FormWizard.TabContent component is used to define each tab's content and accepts the following props:

  • title (required): The title of the tab.
  • icon (required): The icon for the tab.
  • children (required): The content of the tab.

Refer to the component's source code or documentation for additional props and details.

Examples

You can find examples of using the react-form-wizard-component in the examples directory.

License

This package is licensed under the MIT License.


Related Posts

Recent Posts

ഇടുക്കിയിലെ മലയോര മേഖലകളിൽ രാത്രിയാത്ര നിരോധിച്ചു. രാത്രി ഏഴു മുതൽ രാവിലെ ആറു വരെയാണ് നിരോധനം

ഏന്തയാർ ഈസ്റ്റിൽ പ്രളയത്തിൽ തകർന്ന പാലത്തിന് പകരം പുതിയ പാലം നിർമ്മിക്കുവാൻ താത്ക്കാലിക പാലം പൊളിച്ച് നീക്കി

Explore the Investment Opportunities: A Comprehensive Guide to Different Types of Mutual Funds

Title: Understanding Mutual Funds: A Beginner's Guide to Investing

തീവ്രമഴ മുന്നറിയിപ്പിന്റെ പശ്ചാതലത്തിൽ സംസ്ഥാനം ജാഗ്രതയിൽ

250,000 അപേക്ഷകൾ വർദ്ധിച്ചതിനാൽ ട്രാൻസ്‌പോർട്ട് കമ്മീഷണർ പരിശോധന പുനരാരംഭിക്കും

ഏലക്കയിൽ കീടനാശിനി സാന്നിധ്യം; ആറര ലക്ഷത്തിലധികം ടിൻ അരവണ നശിപ്പിക്കാൻ ടെൻഡർ ക്ഷണിച്ച് ദേവസ്വം ബോർഡ്‌

ഭീമൻ പാറക്കഷണങ്ങൾ അടർന്ന് ദേശീയ പാതയിലേക്ക് വീഴുന്നത് പതിവാകുന്നു. കുട്ടിക്കാനത്തിനും മുണ്ടക്കയത്തിനുമിടയിൽ നിലനിൽക്കുന്നത് വൻ അപകട ഭീഷണി

ചക്രവാതച്ചുഴി:അതിശക്തമായ മഴ വരുന്നു

പ്ലസ് വൺ പ്രവേശനം. അക്ഷയയിൽ തിക്കി തിരക്കേണ്ട, നെറ്റിവിറ്റി/ജാതി തെളിയിക്കാൻ പത്താംതരം സർട്ടിഫിക്കറ്റ് മതി