Skip to main content

PinInput

One-time-code / PIN entry with separate cells and a single hidden input, so paste and autofill work.

Usage

import {PinInput} from 'rn-inkpad';

<PinInput length={6} onComplete={verify} autoFocus />
<PinInput length={4} secure variant="underline" />
<PinInput length={4} defaultValue="1234" error />

Props

NameTypeDefaultDescription
lengthnumber4Number of cells.
valuestringControlled value.
defaultValuestring''Initial value (uncontrolled).
onChange(value: string) => voidCalled on every change.
onComplete(value: string) => voidCalled once all cells are filled.
securebooleanfalseMasks the digits.
numericbooleantrueAccept digits only.
keyboardTypeKeyboardTypeOptionsnumber-padKeyboard.
autoFocusbooleanfalseFocus on mount.
disabledbooleanfalseDisables input.
errorbooleanfalseError state (red border).
variant'box' | 'underline'boxCell style.
sizenumber48Cell size.
gapnumber10Space between cells.
radiusnumbertheme radius mdCell radius (box).
colorstringtheme primaryFocused cell color.
borderColorstringtheme borderIdle cell color.
focusedColorstringcolorFocused cell color.
errorColorstringtheme errorError color.
textColorstringtheme textDigit color.
backgroundColorstringtheme surface (box)Cell background.
style, cellStyle, textStyleStylePropCustom styles.