Skip to main content

Event Handling

Event Handling

The FormWizard component provides the following event handling options:

EventDescription
onCompleteA callback function that is called when the form wizard is completed.
onTabChangeA callback function that is called when the active tab is changed.

onComplete

The onComplete event is triggered when the form wizard is completed. You can assign a callback function to this event prop to perform any desired actions upon completion.

Example usage:

<FormWizard onComplete={handleFormWizardComplete}>{/* ... */}</FormWizard>

In the above example, handleFormWizardComplete is a function that will be called when the form wizard is completed.

onTabChange

The onTabChange event is triggered when the active tab in the form wizard is changed. You can assign a callback function to this event prop to perform any desired actions when the active tab changes.

Example usage:

const handleTabChange = ({ previousIndex, currentIndex }) => {
// Do something when the active tab changes
console.log(`Active tab changed to index ${(previousIndex, currentIndex)}`);
};
<FormWizard onTabChange={handleTabChange}>{/* ... */}</FormWizard>;

In the above example, handleTabChange is a function that will be called when the active tab changes in the form wizard.

You can define these event handling functions in your component and implement any logic or functionality according to your requirements.

Make sure to check the documentation or source code of the FormWizard component for additional details and available parameters for these event handling options.