1.0.4 • Published 7 years ago

react-material-ui-number-input v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

React MUI NumberField

Number field component for React Material UI.

Install

npm install react-material-ui-number-input --save

Using

import ReactDom from 'react-dom';
import React from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import NumberField from 'react-material-ui-number-input';

// Needed for onTouchTap material-ui
// http://stackoverflow.com/a/34015469/988941
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();

ReactDom.render(
	(<MuiThemeProvider>
		<NumberField name="name" min={-100} max={100} />
	</MuiThemeProvider>),
	window.document.getElementById('app'),
);

API

NameTypeDefaultDescription
childrennode
classNamestringThe css class name of the root element.
disabledboolfalseDisables the input field if set to true.
idstringThe id prop for the input field.
namestringName applied to the input.
defaultValuenumberThe number to use for the default value.
minnumberThe number to use for the minimum limit
maxnumberThe number to use for the maximum limit
valuestringThe value of the input field.
onChangefunctionCallback function that is fired when input filed must change.
floatingLabelTextnodeThe content to use for the floating label element.
styleobjectOverride the inline-styles of the root element.