JSPM

rn-phone-number-mask

1.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q41448F
  • License MIT

US telephone mask for text input

Package Exports

  • rn-phone-number-mask

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rn-phone-number-mask) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rn-phone-number-mask

US telephone mask for text input

Instalation

npm i rn-phone-number-mask

Example

Transforms 1234567890 into (123) 456-7890 dynamically

Usage

Import

import PhoneNumberMask from 'rn-phone-number-mask'

And use it this way:

<PhoneNumberMask
  containerStyle={styles.containerStyle}
  style={styles.inputStyle}
  onNumberChange={phoneNumber => this.setState({ phoneNumber })} />

Props

Prop Description Type Default
onNumberChange This function is triggered when TextInput value changes (returns value with mask applied) Function Required
containerStyle TextInput container style Object {}
style InputText style Object {}
maxLength Max length of phone number Number 14

Enjoy!