-
Notifications
You must be signed in to change notification settings - Fork 1
/
PinInput.ts
40 lines (39 loc) · 901 Bytes
/
PinInput.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from 'react';
export type PinInputProps = {
values: string[];
type?: 'number' | 'text';
mask?: boolean;
size?: 'xs' | 'sm' | 'md' | 'lg';
validate?: string | string[] | RegExp;
format?: (char: string) => string;
showState?: boolean;
autoFocus?: boolean;
autoTab?: boolean;
containerStyle?: React.CSSProperties;
inputStyle?: React.CSSProperties;
borderColor?: string;
errorBorderColor?: string;
focusBorderColor?: string;
validBorderColor?: string;
onChange?: (
value: string | string[],
index: number,
values: string[]
) => void;
onComplete?: (values: string[]) => void;
} & Pick<
React.InputHTMLAttributes<HTMLInputElement>,
| 'aria-describedby'
| 'aria-label'
| 'aria-labelledby'
| 'autoComplete'
| 'disabled'
| 'id'
| 'inputMode'
| 'name'
| 'onBlur'
| 'onFocus'
| 'onKeyDown'
| 'placeholder'
| 'required'
>;