You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

react-native-confirmation-code-field

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-confirmation-code-field

A react-native component to input confirmation code for both Android and IOS


Version published
Weekly downloads
73K
decreased by-1.36%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-native-confirmation-code-field

npm npm downloads Travis

A react-native confirmation code field compatible with iOS, Android and Web Platforms (based on this project Migration Guide)

Component features:

  • 🔮 Simple. Easy to use;
  • 🚮 Clearing part of the code by clicking on the cell;
  • 🍎 Support "fast paste SMS-code" on iOS. And custom code paste for Android;
  • ⚡ TextInput ref support;
  • 🛠 Extendable and hackable;
  • 🤓 Readable changelog.

Screenshots

Install

yarn add react-native-confirmation-code-field

How it work

I use an invisible <TextInput/> component that absolutely stretched over <Cell/> components to have ability paste code normally on iOS issue#25

import React, {useState} from 'react';
import {Text} from 'react-native';

import {CodeFiled, Cursor} from 'react-native-confirmation-code-field';

const CELL_COUNT = 6;

const App = () => {
  const [value, setValue] = useState('12');

  return (
    <CodeFiled
      value={value}
      onChangeText={setValue}
      cellCount={CELL_COUNT}
      renderCell={({index, symbol, isFocused}) => (
        //
        <Text key={index}>{symbol || (isFocused ? <Cursor /> : null)}</Text>
      )}
    />
  );
};

Keywords

FAQs

Package last updated on 02 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc