Summary
Modal currently only renders all elements in a single static view. Add multi-step modal support, splitting a modal into sequential pages with next/back navigation and animated transitions between steps.
Proposed API
<Modal
title="Register"
theme="Crimson"
steps={[
{
title: 'Account Details',
elements: [
{ type: 'text', name: 'firstName', placeholder: 'First Name', amount: 1 }
]
},
{
title: 'Security',
elements: [
{ type: 'password', name: 'password', placeholder: 'Password', amount: 1 }
]
}
]}
onSubmit={(data) => console.log(data)}
/>
Requirements
- Render only the current step's
elements, reusing existing field rendering logic.
Next/Back buttons replace the default submit button, with Next becoming submit on the final step.
- GSAP-animated transitions between steps, consistent with existing modal animations.
data and errors persist across steps.
- Existing
elements based modals must continue to work unchanged.
Additional Information
- Check
SerializeData and the field rendering block in modal.jsx before starting.
- Validation should run per-step via
handleValidation before allowing the Next page.
- To test:
npm install && npm run dev, add a multi-step example to devbench modal.jsx.
Summary
Modalcurrently only renders allelementsin a single static view. Add multi-step modal support, splitting a modal into sequential pages withnext/backnavigation and animated transitions between steps.Proposed API
Requirements
elements, reusing existing field rendering logic.Next/Backbuttons replace the default submit button, withNextbecoming submit on the final step.dataanderrorspersist across steps.elementsbased modals must continue to work unchanged.Additional Information
SerializeDataand the field rendering block inmodal.jsxbefore starting.handleValidationbefore allowing theNextpage.npm install && npm run dev, add a multi-step example to devbenchmodal.jsx.