zaguiini / formik-wizard

A multi-step form component powered by formik and react-albus
MIT License
86 stars 26 forks source link

Can you also have example for radio buttons and checkbox? #36

Open gilbertlucas46 opened 3 years ago

gabeamaleoni commented 2 years ago

Hey @gilbertlucas46 - Here was my solution for adding checkboxes (or any other form components like radio buttons, select dropdowns etc.)

import { Field } from 'formik';
import { Switch } from 'formik-mui';

<FormControlLabel
     control={
        <Field
            name="[your-form-field-name]"
            component={Switch}
            type="checkbox"
         />
      }
    label="Do you want to do this"/>