New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

formik-material-ui

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formik-material-ui

[![Build Status](https://travis-ci.org/stackworx/formik-material-ui.svg?branch=master)](https://travis-ci.org/stackworx/formik-material-ui) [![license](https://badgen.now.sh/badge/license/MIT)](./LICENSE) [![Coverage Status](https://coveralls.io/repos/git

  • 0.0.16
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18K
decreased by-6.59%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status license Coverage Status

Formik Material Ui

Bindings for using Formik with Material UI.

Getting Started

yarn add formik-material-ui

Goals

  • Convenience: This project containis mostly the tedious wrapper code needed to convert the formik field props to Material UI shapes. Which is why certain assumptions are made (See below). The mapping functions are exported so you can build on top of them for more specialized behavior

Form Behaviour Assumptions

  • Errors are only displayed on touched/dirty fields
  • Fields are disabled during submission

Non Goals

  • Negate the need to import Material UI directly or create custom components

FAQ

Custom onChange

import MuiTextField from '@material-ui/core/TextField';
import {fieldToTextField, TextField, TextFieldProps} from 'formik-material-ui';
...
const UppercasingTextField = (props: TextFieldProps) => (
  <MuiTextField
    {...fieldToTextField(props)}
    onChange={event => {
      const {value} = event.target;
      props.form.setFieldValue(
        props.field.name,
        value ? value.toUpperCase() : ''
      );
    }}
  />
);
...

Composing mappers

import {fieldToTextField} from 'formik-material-ui';

<Field name="name" render={(props) => (<div>
  <Comp1 {...fieldToText(props)}>
  <Comp2 {...fieldToText(props)}>
  ...
</div>)} />

Development

yarn install
yarn storybook

Running tests

yarn prepublishOnly

Keywords

FAQs

Package last updated on 01 Dec 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc