react-auth-code-input
Version:
One-time password (OTP) React input component, uncontrolled, zero dependencies, fully tested.
21 lines (20 loc) • 700 B
TypeScript
import React from 'react';
declare const allowedCharactersValues: readonly ["alpha", "numeric", "alphanumeric"];
export declare type AuthCodeProps = {
allowedCharacters?: typeof allowedCharactersValues[number];
ariaLabel?: string;
autoFocus?: boolean;
containerClassName?: string;
disabled?: boolean;
inputClassName?: string;
isPassword?: boolean;
length?: number;
placeholder?: string;
onChange: (res: string) => void;
};
export declare type AuthCodeRef = {
focus: () => void;
clear: () => void;
};
declare const AuthCode: React.ForwardRefExoticComponent<AuthCodeProps & React.RefAttributes<AuthCodeRef>>;
export default AuthCode;