How to build multistep form? #1869
-
How to build a multistep form?I want to start by writing, "Yes, I know forms are the absolute worst thing ever to have to work with," but this is a vital feature for my startup and I need some help 🆘. What do I want/need to use?I want to use I am aware of this X post (tweet) by @shadcn himself, which shows an animated multistep form with validation, but I don't know how to replicate it. I have some crazy features I also need, like date-range-pickers (I told you it was crazy) and a kind of sub-form thing. I don't think you need to worry though. It's really the base concept I need to understand. One last thing...One of the most important things I need is good a11y. W/out that, I can't build my app. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 14 replies
-
I think this might help #318, I will mark this as the answer if the PR gets approved and it works as a multistep form. But please, give me your ideas if you have any! |
Beta Was this translation helpful? Give feedback.
-
I'm closing as the step component looks like it will be merged soon. |
Beta Was this translation helpful? Give feedback.
-
This is the repo for the multi step form in the tweet |
Beta Was this translation helpful? Give feedback.
-
For anyone reaching till this point, I am doing some research for my company on which form library to choose: formik or react-hook-form. For that I had to create a multi-step form for both so that we can compare DX and features provided by each library. Done for both libraries. Features include:
All those are done with the help of hooks and components like Used NextJs app router and here is the link to the page: https://github.com/dorji-dev/formik-vs-react-hook-form/blob/main/src/app/hook-multi-step/page.tsx You can find the instructions on how to integrate it with an existing project via the repo README file A preview: |
Beta Was this translation helpful? Give feedback.
-
I would totally suggest you to use Formity. It is a package that allows you to build dynamic multi-step forms with just a JSON. |
Beta Was this translation helpful? Give feedback.
-
Here is a very good effort by @Ali-Hussein-dev in best traditions of Shadcn. Has a schema driven multistep form, form-builder and code generator as well |
Beta Was this translation helpful? Give feedback.
I think this might help #318, I will mark this as the answer if the PR gets approved and it works as a multistep form.
But please, give me your ideas if you have any!