OtpInput
Component to input OTP or PIN codes with multiple boxes.
Supports custom placeholder, cursor, modes, sizes, and fully customizable behavior.
Usage Playground
Max Length
Mode
box
dash
With Cursor
With Alphanumeric Keyboard
Code Snippet
import { OtpInput } from "@react-native-blossom-ui/components";
function Usage() {
return (
<OtpInput/>
);
}
Usage
function OtpInputUsage() {
return (
<View>
<OtpInput secureTextEntry onComplete={(otp) => alert(otp)} />
</View>
)
}
Modes
Use the mode prop to switch between default underline or box-style inputs.
function OtpInputModes() {
return (
<View>
<OtpInput mode="box" />
<OtpInput mode="dash" />
</View>
)
}
Placeholder
Use the placeholder prop to show hint characters in each input box.
function OtpInputPlaceholder() {
return (
<View>
<OtpInput placeholder="*" status="success" />
</View>
)
}