KaiHotz / react-formik-ui

A simple component library, composed out of pure HTML form elements to make your live easier composing forms with Formik and React
https://kaihotz.github.io/react-formik-ui/
MIT License
164 stars 15 forks source link

Custom Label Component #61

Closed p-j closed 3 years ago

p-j commented 3 years ago

Hi @KaiHotz,

I'm considering using react-formik-ui for a project, so first, thanks for putting this together, it looks really handy. A concern of mine though, is that, down the line, I'd like to be able to provide custom styling/components to every pieces of UI, including label & hint or error messages which currently aren't easily styled when one's using CSS-in-Js setup.

I'm thinking of something as simple as

 <Input
  name='nameExample'
  label={<Label>Name</Label>}
  required
/>

The withLabel HoC could handle both being given a component or a string and act accordingly.

Would you consider a PR that would add such possibilities? If so I could allocate some time to work on that in the future. Thanks

KaiHotz commented 3 years ago

Hi @p-j Thanks for reaching out, i'm glad that you are considering using my library, of course I'll consider a PR for changes that you need.

p-j commented 3 years ago

Hi! in the end I didn't use your library as using Formik directly was better for my use case. I'll close this issue for now.

KaiHotz commented 3 years ago

@p-j That's fine, anyhow i just updated and implemented your suggestion