Saltar al contenido principal

PinInput

Entrada de código OTP / PIN con celdas separadas y un único input oculto, así funcionan pegar y autocompletar. autofill work.

Uso

import {PinInput} from 'rn-inkpad';

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

Props

NombreTipoPor defectoDescripción
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.