1.1.6 • Published 1 year ago

sms-entry-code-rn v1.1.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

sms-entry-code-rn

React Native. Custom component to confirm SMS code.

Installation

Run the following command to install the package.:

$ npm i sms-entry-code-rn

npm.io

Usage

Example:

import SmsEntryCode from 'sms-entry-code-rn'

export default function App() {
    return (
        <View style={styles.container}>
            <Text>Confirmation</Text>
            <SmsEntryCode />
            <StatusBar style="auto" />
        </View>
    );
}

Props

  1. boxNumber | Number
  2. placeholder | String
  3. boxColor | String
  4. textColor | String
  5. additionalStyle | Object
  6. codeHandler | Function
  7. activeBackground | String
  8. currentBoxTextColor | String

Definition Props

PropsDefinition
boxNumberdefines the number of boxes where the limit is 6.
placeholderrepresents the provisional text.
boxColorset the background color of the boxes.
textColorset the text color of the boxes.
additionalStyleset additional styles for boxes.
codeHandlermethod or function to capture the value.
activeBackgroundSet the background color when simulating a click.
currentBoxTextColorsets the text color of the current box.

Code Example

import SmsEntryCodeRn from 'sms-entry-code-rn';

export default function App() {
    const [code, setMyCode] = useState('')
    return (
        <View style={styles.container}>
            <Text style={{padding: 20, fontSize: 20}}>My Code: {code}</Text>
            <SmsEntryCodeRn 
                boxNumber={5}
                placeholder='*'
                codeHandler={setMyCode}
                boxNumber={4}
                textColor='#188'
            />
            <StatusBar style="auto" />
        </View>
    );
}

Demostraciòn

Example 1


example 1

Example 2:


Example 1


Example 3

dedede

example 2

Autor

  • Nèstor Benjamìn
1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago