0.7.0 • Published 4 years ago
@dooboo-ui/native-search-input v0.7.0
Search Input
Simple search input for react-native.
Installation
yarn add @dooboo-ui/native
or
yarn add @dooboo-ui/native-search-input
Usage
- debounced input
- reset button
- customizable icon
Props
export interface SearchInputProps {
value: string;
onDebounceOrOnReset?: (value: string) => void;
style?: StyleProp<ViewStyle>;
debounceDelay?: number;
customIcon?: React.ReactNode;
placeholderText?: string;
}
necessary | types | default | info | |
---|---|---|---|---|
value | ✓ | string | undefined | |
onDebounceOrReset | ✓ | (string) => void | undefined | |
style | StyleProp<ViewStyle> | undefined | container style | |
debounceDelay | number | 400 | ||
customIcon | React.ReactNode | magnifier icon component | ||
placeholderText | string | 검색어를 입력해주세요. |
Getting started
Import
import { SearchInput } from '@dooboo-ui/native'; // or import SearchInput from '@dooboo-ui/native-search-input';
Usage
const SearchInputWithState = () => { const [value, setValue] = useState(''); return ( <> <SearchInput value={value} onDebounceOrOnReset={setValue} debounceDelay={number('delay', 400)} placeholderText={text('placeholder', '')} /> <Value>{`value (after debounced delay) : ${value}`}</Value> </> ); };