Nuxt UI w/Form Builder (Schema Based)
There are many great vue form tools out there... but has anybody found an option that works well with Nuxt UI? Even if it's an unfinished project? I'm looking to plug into Sanity CMS before I roll my own.
2 Replies
Hi @saltytostitos. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, Nuxt UI provides a Form component that works well with schema-based validation. You can use the Form component to validate form data using schema libraries such as Yup, Zod, Joi, Valibot, Superstruct, or your own validation logic. The form component requires two props:
state
- a reactive object holding the form's state, and schema
- a schema object from a validation library.
Here is an example of how to use it with Yup:
Please note that no validation library is included by default, so ensure you install the one you need.
For more details, you can refer to the Nuxt UI Form Component Documentation (https://ui.nuxt.com/components/form).
As for integrating with Sanity CMS, you would need to fetch the data from Sanity and populate the form's state with it. However, the specifics of this integration are not covered in the provided knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@687416355380920340> Kapa.ai is still learning and improving, please let me know how I did by reacting below.