Skip to content

styleschool/uniforms-masked-phone-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uniforms-masked-phone-field

React component for unifroms-material with input mask

Install

npm i styleschool/uniforms-masked-phone-field

Example

import MaskedField from 'uniforms-masked-phone-field';
import { AutoForm, AutoField } from 'uniforms-material';
import SimpleSchema from 'simpl-schema';
import SimpleSchema2Bridge from 'uniforms/SimpleSchema2Bridge';

const Bridge = new SimpleSchema2Bridge(new SimpleSchema({
  phone: {
    type: String,
    uniforms: {
      component: (props: any) => <MaskedField {...props} />,
    },
  },
  // Region field auto-implemented in MaskedField.
  // It have no need to be placed in Autoform manualy.
  // ATTEMPT! You must use AutoForm component with AutoFiled, but not by itself.
  region: {
    type: String,
  }
}));

<AutoForm schema={Bridge}>
  <AutoField name="phone"/>
</AutoForm>

About

React component for unifroms-material with input mask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published