
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@dccs/react-formik-mui
Advanced tools
Simple Formik <-> MaterialUI wrappers.
Here is a Demo:https://dccs-it-business-solutions.github.io/react-formik-mui/
You should install react-formik-mui with npm or yarn:
npm install @dccs/react-formik-mui
or
yarn add @dccs/react-formik-mui
This command will download and install react-formik-mui
Dependencies required by FormikTextField,-Select,-Switch,-Checkbox,-Radio
npm install formik
npm install @material-ui/core
Dependencies required by FormikDatepicker You can also look at the documentation of the MUI-Datepicker
npm install @material-ui/pickers
npm install @date-io/date-fns@latest
npm install date-fns@latest
All MUI-Components are used inside of the renderfunction of a Formik-FastField.
Codesandbox with all components
More Examples:
FormikTextField
FormikTextField-Props are almost identical to Material-UI TextField Props The only difference is, that "name" is required.
<FormikTextField label="First Name" name="firstName" />
<FormikTextField label="Salary" name="salary" type="number" />
<FormikTextField label="Multiline" name="multiline" multiline />
<FormikTextField label="Helpertext" name="helpertext" helperText="Info" />
<FormikTextField label="Error" name="error" error={true} helperText="Error" />
<FormikTextField label="Variant Outline" name="outline" variant="outlined" />
<FormikTextField label="Variant filled" name="filled" variant="filled" />
<FormikTextField label="Password" name="password" type="password" />
<FormikTextField
label="Input Adornments"
name="adornments"
InputProps={{
startAdornment: (
<InputAdornment position="start">
<AccountCircle></AccountCircle>
</InputAdornment>
)
}}
/>
FormikCheckbox
FormikCheckbox-Props are almost identical to https://material-ui.com/api/checkbox/
It also accepts formControlLabelProps and formHelperTextProps.
<FormikCheckbox label="Checkbox" name="checkbox"></FormikCheckbox>
Label Placement
<FormikCheckbox
label="Checkbox Bottom"
name="checkboxBottom"
formControlLabelProps={{ labelPlacement: "bottom" }}
/>
FormikSwitch
FormikSwitch-Props are almost identical to https://material-ui.com/api/switch/
It also accepts formControlLabelProps and formHelperTextProps.
Label Placement
<FormikSwitch
label="Switch Bottom"
name="switchBottom"
formControlLabelProps={{ labelPlacement: "bottom" }}
/>
FormikSelect FormikSelect-Props are almost identical to https://material-ui.com/api/select/
It also accepts formControlProps and formHelperTextProps.
<FormikSelect
label="Select"
name="select"
options={[
{ key: 1, value: "Entry 1" },
{ key: 2, value: "Entry 2" },
{ key: 3, value: "Entry 3" }
]}
/>
Without Label
<FormikSelect
name="select2"
options={[
{ key: 1, value: "Entry 1" },
{ key: 2, value: "Entry 2" },
{ key: 3, value: "Entry 3" }
]}
/>
FormikRadio
FormikRadio-Props are almost identical to https://material-ui.com/api/radio/
It also accepts formControlLabelProps and formHelperTextProps.
<FormControl>
<FormLabel>Gender</FormLabel>
<RadioGroup name="radioGroup">
<FormikRadio label="Female" name="radioGroup" value="female" />
<FormikRadio label="Male" name="radioGroup" value="male" />
<FormikRadio label="Other" name="radioGroup" value="other" />
<FormikRadio
label="(Disabled option)"
name="radioGroup"
value="disabled"
disabled
/>
</RadioGroup>
</FormControl>
FormikDatepicker
FormikDatepicker-Props are almost identical to https://material-ui-pickers.dev/api/KeyboardDatePicker
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<FormikDatepicker name="date" label="Date"></FormikDatepicker>
</MuiPickersUtilsProvider>
Custom Components
For more information: https://jaredpalmer.com/formik/docs/api/fastfield
<FastField
name="custom"
render={(fastFieldProps: FastFieldProps<any>) => (
<React.Fragment>
{/* Merge FastField-Props into Input */}
<input {...fastFieldProps.field} />
{/* Show Errormessage after Touch */}
{formikProps.touched.custom ? formikProps.errors.custom : null
</React.Fragment>
)}
/>
With HandleChange
<FastField
name="custom2"
render={(fastFieldProps: FastFieldProps<any>) => (
<React.Fragment>
{/* Merge FastField-Props into Input */}
<input
{...fastFieldProps.field}
onChange={(e: React.ChangeEvent<any>) => {
//Do stuff before HandleChange
formikProps.handleChange(e);
//Do stuff after HandleChange
}}
/>
{/* Show Errormessage after Touch */}
{formikProps.touched.custom2 ? formikProps.errors.custom2 : null}
</React.Fragment>
)}
/>
@dccs/react-formik-mui is MIT licensed
FAQs
Simple Formik <-> MaterialUI wrappers
We found that @dccs/react-formik-mui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.