Replies: 2 comments 7 replies
-
|
Thanks for creating this discussion! I would love to have a multi step form API. How should we call it? I would probably make it look like this: import { getInput } from '@formisch/...';
// Create the multi step form
const multipStepForm = useMultiStepForm({
schemas: { step1: Step1Schema, step2: Step2Schema, ... },
// other config here...
});
// Access and use a specific step
const input = getInput(multipStepForm.step1);I wonder if there is a need for properties to read the current step and functions to navigate between steps. I am also not sure if something like I look forward to get feedback on this! It is important to me to understand the use cases and the functionality such an API should provide before we actually start implementing it. |
Beta Was this translation helpful? Give feedback.
-
|
@dosu can you research and brainstorm for us? How do others design such a multi step form API? How would you design such an API for Formisch? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a discussion about multi-step form improvements and the API design. (Reference: Discord message)
My current workaround for multi-step forms is to create a separate form for each step. I'm using Vue.
When clicking on the
Nextbutton, the current form gets submitted and therefore validated.If the validation is successful, the next step/form is displayed.
To implement the step functionality, I'm using the
useStepper()composable of the VueUse library: https://vueuse.org/core/useStepperIt has a great API and can perhaps be used as inspiration for Formisch.
In my case, the user can only go to the next step, if the current step is validated successfully.
Maybe there are also different cases, e.g. the current step doesn't need to be validated right away.
Beta Was this translation helpful? Give feedback.
All reactions