Socket
Book a DemoInstallSign in
Socket

input-otp-native

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

input-otp-native

One time passcode Input For React Native/Expo. Unstyled and fully customizable.

latest
Source
npmnpm
Version
0.5.0
Version published
Maintainers
1
Created
Source

Input OTP Native

Input OTP Native 🔐

✨ One time passcode Input For React Native/Expo. Unstyled and fully customizable. ✨

Test status version downloads license Star on GitHub

Features

  • 📱 Built specifically for React Native/Expo
  • 🎨 Fully customizable styling with render props ( supports nativewind )
  • 📋 Four copy paste styles (Apple, Stripe, Revolt, Dashed)
  • 🧪 100% test coverage
  • 🔄 Easily animated with react-native-reanimated
  • 🌐 Web support with using otp-input
## npm
npm install input-otp-native

## yarn
yarn add input-otp-native

#pnpm
pnpm add input-otp-native

Documentation

API Reference

OTPInput Props

PropTypeDefaultDescription
maxLengthnumberRequiredNumber of OTP digits
render(props: RenderProps) => ReactNodeRequiredRender function for OTP slots
valuestringundefinedControlled value of the input
onChange(value: string) => voidundefinedCallback when value changes
onComplete(value: string) => voidundefinedCallback when all digits are filled
containerStyleViewStyleundefinedStyle for the container
patternstringundefinedRegex pattern for input validation
textAlign'left' | 'center' | 'right''left'Text alignment within input
pasteTransformer(pasted: string) => stringundefinedTransform pasted text

RenderProps

PropTypeDescription
slotsSlotProps[]Array of slot objects to render
isFocusedbooleanWhether the input is focused

SlotProps

PropTypeDescription
charstring | nullCharacter in the slot
isActivebooleanWhether the slot is active
hasFakeCaretbooleanWhether to show fake caret
placeholderCharstring | nullPlaceholder character

Web support

The library is mainly inspired by otp-input and has a similar API, so we recommend using it on the web.

We can easily create the same component for web and create a new file for it (example/src/examples/apple.web.tsx)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Credits

Keywords

react-native

FAQs

Package last updated on 22 Jun 2025

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