Please see the deprecation notice.
react-maskedinput form element that works with react-bootstrap.
- For
react-bootstrap< 0.29.0, use v0.1.0. - For
react-bootstrap>= 0.29.0 and < 1.0, use v0.4.0. - For
react-bootstrap>= 1.0, use v0.5.0.
- Install the package:
npm install react-bootstrap-maskedinput --saveoryarn add react-bootstrap-maskedinput - Import the component:
import MaskedFormControl from 'react-bootstrap-maskedinput' - Use in your JSX -- the component accepts all the usuals from react-bootstrap's
FormControlcomponent plus react-maskedinput'sMaskedInputcomponent.
Simple example:
import MaskedFormControl from 'react-bootstrap-maskedinput'
export default class MyForm extends React.Component {
render () {
return (
<FormGroup>
<ControlLabel>Phone Number</ControlLabel>
<MaskedFormControl type='text' name='phoneNumber' mask='111-111-1111' />
</FormGroup>
);
}
}- git
- npm
- yarn (optional/recommended)
- Clone the repository (
git clone git@github.com:schneidmaster/react-bootstrap-maskedinput.git) - Install dependencies:
npm installoryarn install
Run npm run example or yarn example and open http://localhost:8080. Make changes in src/index.js or try different setups in example/index.js.
- Run
npm run buildoryarn buildto build an ES5 version of the class.
- Fork it ( https://github.com/schneidmaster/react-bootstrap-maskedinput/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
MIT