vantezzen / auto-form

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

Lookup Field ? #11

Closed leandrorazevedo closed 11 months ago

leandrorazevedo commented 1 year ago

Would it be possible to create a select with data from an api? Something similar to a lookup field.

vantezzen commented 1 year ago

I don't know about lookup fields but you can look at https://github.com/vantezzen/auto-form/blob/main/src/examples/Api.tsx for an example on how to generate the form schema dynamically

jedimonkey commented 1 year ago

This doesn't support name/value pairs does it? I've been mucking around with your form (nice work btw!) and I have an idea on how to make it work, so will try to have a crack on this... time permitting 😅

darkterminal commented 1 year ago

I have been done with this and I will make a PR! image

The new fieldType is options 🎉