Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gilbertlucas46 opened this issue Oct 9, 2020 · 1 comment
Open

Comments

@gilbertlucas46
Copy link

No description provided.

@gabeamaleoni
Copy link

gabeamaleoni commented Feb 24, 2022

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

  • Download formik-mui from npm
  • import the Switch component and insert it into a formik <Field/> component like this:
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"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants