react-native-confirmation-code-field
Version:
A react-native component to input confirmation code for both Android and IOS
24 lines (23 loc) • 950 B
TypeScript
import { ComponentPropsWithoutRef, ComponentType, ElementType, FC, JSX, ReactNode, Ref } from 'react';
import type { StyleProp, TextInputProps, TextStyle, ViewProps } from 'react-native';
import { TextInput } from 'react-native';
export interface RenderCellOptions {
symbol: string;
index: number;
isFocused: boolean;
}
export interface Props extends Omit<TextInputProps, 'style'> {
renderCell: (options: RenderCellOptions) => ReactNode;
RootProps?: ViewProps;
RootComponent?: ComponentType<ViewProps>;
rootStyle?: ViewProps['style'];
textInputStyle?: StyleProp<TextStyle>;
cellCount?: number;
ref?: Ref<TextInput>;
}
export interface CodeFieldOverridableComponent extends FC<Props> {
<TInput extends ElementType>(props: {
InputComponent: TInput;
} & Omit<ComponentPropsWithoutRef<TInput>, 'style'> & Props): JSX.Element | null;
}
export declare const CodeField: CodeFieldOverridableComponent;