@td-design/react-native
Version:
react-native UI组件库
35 lines • 1.24 kB
TypeScript
import { FC, PropsWithChildren } from 'react';
import { KeyboardTypeOptions, ReturnKeyTypeOptions, StyleProp, TextStyle, ViewStyle } from 'react-native';
export type SearchBarProps = PropsWithChildren<{
/** 搜索框的placeholder */
placeholder?: string;
/** 是否展示取消按钮 */
showCancelButton?: boolean;
/** 是否允许清除 */
allowClear?: boolean;
/** 搜索框是否禁用 */
disabled?: boolean;
/** 搜索框的默认值 */
defaultValue?: string;
/** 是否自动focus */
autoFocus?: boolean;
/** 取消文字 */
cancelText?: string;
/** 键盘下方的按钮类型,默认为搜索 */
returnKeyType?: ReturnKeyTypeOptions;
/** 弹出键盘类型 */
keyboardType?: KeyboardTypeOptions;
/** 最外层view的样式 */
style?: StyleProp<ViewStyle>;
/** input框的样式 */
inputStyle?: StyleProp<TextStyle>;
/** 输入改变时的回调 */
onChange?: (text: string) => void;
/** 提交时的搜索 */
onSearch?: (text: string) => void;
/** 取消按钮按下时的不透明度 */
activeOpacity?: number;
}>;
declare const SearchBar: FC<SearchBarProps>;
export default SearchBar;
//# sourceMappingURL=index.d.ts.map