一个与 iOS、Android 和 Web 兼容的 react-native 确认码字段
一个与 iOS、Android 和 Web 兼容的 react-native 确认码字段
A simple react-native confirmation code field compatible with iOS, Android.
Simple and tiny 3.8 KB. Easy to use;
React Compiler compatible;
Clearing part of the code by clicking on the cell;
Support "fast paste SMS-code" on iOS & Web. And custom code paste for Android;
⚡ TextInput ref support;
Highly customizable. Can be used as masked TextInput;
Readable changelog.
yarn add react-native-confirmation-code-field
# ^^^ React 19 required!
# if you want to use it with React 18, use version 8.x.x
I use an invisible component that will be stretched over components.
JSX structure looks like that:
// Root view (rectangle with a red border on 3d visualization below)
// Each Cell element is result of a `renderCell` function (gray boxes)
1
2
3
|
// Invisible Text Input with absolute position (gray rectangle with text '123')
It needs to solve next problems:
I took a minimal implementation approach. It mean that this component provides low-level functionality so you can create incredible UI without tears . I recommend you start with creating your own wrapper where you apply all styles and basic configuration.
You can use a ready-made solution out of the box:
…
For [email protected] and below use yarn add react-native-confirmation-code-field@6, otherwise use the latest version yarn add react-native-confirmation-code-field
暂无开放 Issues,或尚未同步最近议题。