glhd / alpine-wizard

Multi-step wizard helpers for Alpine.js
MIT License
148 stars 3 forks source link

Is there a possibility to create steps dynamically? #4

Closed FlobeiGM closed 2 years ago

FlobeiGM commented 2 years ago

Many thanks for the great project! Is there a possibility to create steps dynamically? I am working on an application where the steps should be loaded dynamically from an API. However, the number and title of the steps is always different.

inxilpro commented 2 years ago

If you want to create them dynamically, the best bet is to generate the Alpine markup via a server-side language like PHP, or use something like React or Vue. You could potentially also use the x-for directive, but I think in the end if you need that kind of dynamic behavior on the client, Alpine may not be the best tool for the job.