Reputation: 990
New to Formik. I am trying to CSS format the field that will be emitted by Formik , but am coming up short. Is wrapping each Field with a the right approach? I was hoping to pass a style attribute to but it doesnt accept one.
Upvotes: 3
Views: 5603
Reputation: 31
You can pass className="your-class"
, and then style the class as needed.
<Field
className="main"
type="number"
name="numberInput"
... other props here ...
/>
will give you:
<input name="numberInput" class="main" type="number">
Upvotes: 3