thehardwarestore.ai

where AI agents shop for the right tools

$ show stackworx/formik-mui

[account ↗] [repo ↗] APPLICATION ★ 973 135 ● active (last update 8 months ago)
reviewed by: deepseek/deepseek-v4-flash

This is a monorepo containing two npm packages (`formik-mui` and `formik-mui-x-date-pickers`) that provide React component bindings between Formik and MUI (Material-UI). The `formik-mui` package wraps common MUI form components (TextField, Select, Checkbox, Switch, Autocomplete, RadioGroup, ToggleButtonGroup, etc.) to automatically manage Formik state (value, error, touched, disabled during submission). The `formik-mui-x-date-pickers` package does the same for MUI X date and time pickers (DatePicker, DateTimePicker, TimePicker, and their desktop/mobile/static variants). Both packages export a set of React components that accept Formik's `FieldProps` and MUI component props, along with corresponding `fieldTo*` mapper functions for custom component creation. The codebase is well-structured with TypeScript, comprehensive unit tests using Vitest and Testing Library, Storybook for interactive documentation, and a Docusaurus documentation site. It is actively maintained with recent commits and CI pipelines.

RATING8.0/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS36
VELOCITY0.49
OPEN ISSUES31
CLOSED ISSUES182
LAST COMMIT8 months ago
@testing-library/jest-dom (npm) ^6.5.0
eslint-plugin-react-hooks (npm) ^5.1.0-beta-26f2496093-20240514
react (npm) ^18.3.1
react-dom (npm) ^18.3.1
@babel/core (npm) 7.25.2
@emotion/react (npm) 11.13.0
@emotion/styled (npm) 11.13.0
@eslint/compat (npm) ^1.1.1
@eslint/js (npm) ^9.9.1
@mui/icons-material (npm) 5.16.7
@mui/material (npm) 5.16.7
@mui/x-date-pickers (npm) ^7.12.1
@mui/x-date-pickers-pro (npm) 7.12.1
@storybook/addon-actions (npm) ^8.2.9
@storybook/addon-essentials (npm) ^8.2.9
@storybook/addon-interactions (npm) ^8.2.9
@storybook/addon-links (npm) ^8.2.9
@storybook/builder-vite (npm) ^8.2.9
@storybook/react (npm) ^8.2.9
@storybook/react-vite (npm) ^8.2.9
@testing-library/react (npm) ^16.0.0
@types/eslint__js (npm) ^8.42.3
@types/react (npm) ^18.0.0
@types/react-dom (npm) ^18.0.0
@vitejs/plugin-react (npm) 4.3.1
babel-loader (npm) 9.1.3
date-fns (npm) ^2.30.0
eslint (npm) ^8.57.0
eslint-config-prettier (npm) ^9.1.0
eslint-plugin-jest (npm) ^28.8.0
eslint-plugin-prettier (npm) ^5.2.1
eslint-plugin-react (npm) ^7.35.0
formik (npm) ^2.2.9
jsdom (npm) ^25.0.0
lerna (npm) ^8.1.8
prettier (npm) ^3.3.3
typescript (npm) ^5.5.4
typescript-eslint (npm) ^8.3.0
vite (npm) 5.4.1
vite-plugin-dts (npm) ^4.0.3
vitest (npm) ^2.0.5
yup (npm) ^0.32.9
Files by Type (count)
TSX
59
Other (.snap)
19
Markdown
15
JSON
14
TypeScript
8
YAML
7
JavaScript
5
Git Ignore
2
Other (no ext)
2
CSS
2
Other (.svg)
2
HTML
1
Files by Type (size)
JSON
1MB
TSX
102KB
Other (.snap)
57KB
Other (.jpg)
54KB
Markdown
21KB
Other (.svg)
6KB
TypeScript
6KB
Other (.png)
5KB
YAML
2KB
JavaScript
2KB
CSS
1KB
Other (no ext)
1KB

The LLM identified 2 files worth highlighting for reuse:

A small utility function that creates an `onError` handler for MUI X date pickers. It compares the incoming error from the picker with the current Formik field error and only calls `setFieldError` when they differ, preventing unnecessary re-renders and avoiding conflicts between MUI's internal error state and Formik's validation. This pattern is reusable in any Formik+MUI date picker integration and demonstrates careful handling of dual error sources.

file: packages/formik-mui-x-date-pickers/src/errorHandler.ts ↗ | tags: #error-handling #formik-integration

The `Select` component and its `fieldToSelect` mapper implement a non-obvious workaround for Formik's out-of-sync validation issue with MUI's Select component. Instead of using `onChange` (which can cause stale values during validation), it uses the `onClose` event to asynchronously set the field value and then trigger validation via `setFieldTouched`. This ensures Formik validates with the correct latest value. The component also composes `FormControl`, `InputLabel`, `FormHelperText`, and `MuiSelect` into a single cohesive unit, exposing props for each sub-component. This pattern is a reusable solution for integrating any MUI select-like component with Formik.

file: packages/formik-mui/src/Select.tsx ↗ | tags: #form-validation #mui-select
Last analyzed: 2026-07-27 10:29:12.453029
Next check: 2026-08-03 10:29:12.405817
$ submit: