@uiw/react-native
Version:
UIW for React Native
37 lines (36 loc) • 1.41 kB
TypeScript
import React from 'react';
import { TextInput, TextInputProps, StyleProp, TextStyle, ViewStyle } from 'react-native';
export interface InputProps extends TextInputProps {
/** 限制输入条件 */
rule?: RegExp | ((value: string) => boolean);
/** 输入不合法时触发方法 */
wrongfulHandle?: Function;
/** 如果为 true,文本框是不可编辑的。默认值为 false */
disabled?: boolean;
/** 如果为 true,每次开始输入的时候都会清除文本框的内容。 */
clearText?: boolean;
/** 显示错误 */
error?: boolean;
/** 自定义错误提示 */
renderError?: React.ReactNode;
/** 边框 */
border?: 'bottom' | 'top' | 'left' | 'right' | null | 'always';
/** 边框颜色 */
borderColor?: string;
/** 是否显示清除按钮 */
clear?: boolean;
/** 清除按钮样式 */
clearStyle?: StyleProp<TextStyle>;
/** 自定义清除元素 */
renderClear?: React.ReactNode;
/** 输入框前缀的额外的信息 */
extraStart?: string | React.ReactNode;
/** 输入框末尾额外的信息 */
extraEnd?: string | React.ReactNode;
/** 容器样式 */
containerStyle?: StyleProp<ViewStyle>;
/** 输入框 ref */
inputRef?: React.ForwardedRef<TextInput>;
}
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInput>>;
export default Input;