{"id":13681275,"url":"https://github.com/erikras/redux-form-material-ui","last_synced_at":"2025-05-15T04:00:15.861Z","repository":{"id":38007892,"uuid":"59525159","full_name":"erikras/redux-form-material-ui","owner":"erikras","description":"A set of wrapper components to facilitate using Material UI with Redux Form","archived":false,"fork":false,"pushed_at":"2023-01-12T08:23:25.000Z","size":7529,"stargazers_count":833,"open_issues_count":73,"forks_count":227,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-28T13:09:19.576Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://erikras.github.io/redux-form-material-ui/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erikras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-23T23:25:32.000Z","updated_at":"2025-04-23T10:57:16.000Z","dependencies_parsed_at":"2023-02-09T10:46:53.335Z","dependency_job_id":null,"html_url":"https://github.com/erikras/redux-form-material-ui","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikras%2Fredux-form-material-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikras%2Fredux-form-material-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikras%2Fredux-form-material-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikras%2Fredux-form-material-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikras","download_url":"https://codeload.github.com/erikras/redux-form-material-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252405969,"owners_count":21742690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T13:01:28.696Z","updated_at":"2025-05-15T04:00:15.793Z","avatar_url":"https://github.com/erikras.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Components","React Integration"],"sub_categories":["Side Effects"],"readme":"---\n# redux-form-material-ui\n---\n[![NPM Version](https://img.shields.io/npm/v/redux-form-material-ui.svg?style=flat-square)](https://www.npmjs.com/package/redux-form-material-ui)\n[![NPM Downloads](https://img.shields.io/npm/dm/redux-form-material-ui.svg?style=flat-square)](https://www.npmjs.com/package/redux-form-material-ui)\n[![Build Status](https://img.shields.io/travis/erikras/redux-form-material-ui/master.svg?style=flat-square)](https://travis-ci.org/erikras/redux-form-material-ui)\n[![codecov.io](https://codecov.io/github/erikras/redux-form-material-ui/coverage.svg?branch=master)](https://codecov.io/github/erikras/redux-form-material-ui?branch=master)\n[![CDNJS version](https://img.shields.io/cdnjs/v/redux-form-material-ui.svg)](https://cdnjs.com/libraries/redux-form-material-ui)\n\n### For [`material-ui`](https://github.com/callemall/material-ui) v1-beta support see [5.0](https://github.com/erikras/redux-form-material-ui/tree/5.0) Documentation.\n\n[`redux-form-material-ui`](https://github.com/erikras/redux-form-material-ui) is a set of\nwrappers to facilitate the use of\n[`material-ui`](https://github.com/callemall/material-ui) components with\n[`redux-form`](https://github.com/erikras/redux-form).\n\n---\n\n## [Live Demo](http://erikras.github.io/redux-form-material-ui/) :eyes:\n\n## Installation\n\nUsing [npm](https://www.npmjs.org/):\n\n```bash\n  $ npm install --save redux-form-material-ui\n```\n\n## Available Components\n\n* [AutoComplete](http://www.material-ui.com/#/components/auto-complete)\n* [Checkbox](http://www.material-ui.com/#/components/checkbox)\n* [TimePicker](http://www.material-ui.com/#/components/time-picker)\n* [DatePicker](http://www.material-ui.com/#/components/date-picker)\n* [RadioButtonGroup](http://www.material-ui.com/#/components/radio-button)\n* [SelectField](http://www.material-ui.com/#/components/select-field)\n* [Slider](http://www.material-ui.com/#/components/slider)\n* [TextField](http://www.material-ui.com/#/components/text-field)\n* [Toggle](http://www.material-ui.com/#/components/toggle)\n\n## Usage\n\nRather than import your component class from `material-ui`, import it from `redux-form-material-ui`\nand then pass the component class directly to the `component` prop of `Field`.\n\n```js\nimport { reduxForm, Field } from 'redux-form'\nimport MenuItem from 'material-ui/MenuItem'\nimport { RadioButton } from 'material-ui/RadioButton'\nimport {\n  Checkbox,\n  RadioButtonGroup,\n  SelectField,\n  TextField,\n  Toggle,\n  DatePicker\n} from 'redux-form-material-ui'\n\nclass MyForm extends Component {\n  render() {\n    return (\n      \u003cform\u003e\n        \u003cField name=\"username\" component={TextField} hintText=\"Street\"/\u003e\n\n        \u003cField name=\"plan\" component={SelectField} hintText=\"Select a plan\"\u003e\n          \u003cMenuItem value=\"monthly\" primaryText=\"Monthly\"/\u003e\n          \u003cMenuItem value=\"yearly\" primaryText=\"Yearly\"/\u003e\n          \u003cMenuItem value=\"lifetime\" primaryText=\"Lifetime\"/\u003e\n        \u003c/Field\u003e\n\n        \u003cField name=\"agreeToTerms\" component={Checkbox} label=\"Agree to terms?\"/\u003e\n\n        \u003cField name=\"eventDate\" component={DatePicker} format={null} hintText=\"What day is the event?\"/\u003e\n\n        \u003cField name=\"receiveEmails\" component={Toggle} label=\"Please spam me!\"/\u003e\n\n        \u003cField name=\"bestFramework\" component={RadioButtonGroup}\u003e\n          \u003cRadioButton value=\"react\" label=\"React\"/\u003e\n          \u003cRadioButton value=\"angular\" label=\"Angular\"/\u003e\n          \u003cRadioButton value=\"ember\" label=\"Ember\"/\u003e\n        \u003c/Field\u003e\n      \u003c/form\u003e\n    )\n  }\n}\n\n// Decorate with redux-form\nMyForm = reduxForm({\n  form: 'myForm'\n})(MyForm)\n\nexport default MyForm\n```\n\n## No Default Values\n\nBecause of the strict \"controlled component\" nature of `redux-form`,\nsome of the Material UI functionality related to defaulting of values has been disabled\ne.g. `defaultValue`, `defaultDate`, `defaultTime`, `defaultToggled`, `defaultChecked`, etc.\nIf you need a field to be initialized to a certain state, you should use the `initialValues`\nAPI of `redux-form`.\n\n## Instance API\n\n#### `getRenderedComponent()`\n\nReturns a reference to the Material UI component that has been rendered. This is useful for\ncalling instance methods on the Material UI components. For example, if you wanted to focus on\nthe `username` element when your form mounts, you could do:\n\n```js\ncomponentWillMount() {\n  this.refs.firstField      // the Field\n    .getRenderedComponent() // on Field, returns ReduxFormMaterialUITextField\n    .getRenderedComponent() // on ReduxFormMaterialUITextField, returns TextField\n    .focus()                // on TextField\n}\n```\n\nas long as you specified a `ref` and `withRef` on your `Field` component.\n\n```js\nrender() {\n  return (\n    \u003cform\u003e\n      ...\n      \u003cField name=\"username\" component={TextField} withRef ref=\"firstField\"/\u003e\n      ...\n    \u003c/form\u003e\n  )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikras%2Fredux-form-material-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikras%2Fredux-form-material-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikras%2Fredux-form-material-ui/lists"}