vantezzen / auto-form

🌟 A React component that automatically creates a @shadcn/ui form based on a zod schema.
https://vantezzen.github.io/auto-form/
2.29k stars 81 forks source link

Ignore certain zod field while generating the form #25

Closed ninnroot closed 10 months ago

ninnroot commented 10 months ago

Is there a feature to let you ignore certain fields in the zod schema while generating the form?

For example:

<AutoForm 
    formSchema={formSchema}
    ignoreFields={["foo", "bar"]}>

</AutoForm>
vantezzen commented 10 months ago

AutoForm probably won't support this as it can't validate the schema due to missing fields. You can use zod's omit function to change the schema directly instead.