antd-search-box
An ant design based search box.
Examples
http://localhost:8002/examples
Online examples: http://Alex1990.github.io/antd-search-box/
Install
npm install antd-search-box
Usage
;;;;; { superprops; thisstate = value: undefined keyword: undefined ; } { this; } { this; } { const value keyword = thisstate; return <div style= margin: 32 width: 300 > <div>Current value: value</div> <div>Press `Enter/Return` to search: keyword</div> <div> <SearchBox value=value placeholder="Type the keyword" onChange=thishandleChange onSearch=thishandleSearch /> </div> </div> ; } ReactDOM;
API
SearchBox
props:
name | type | default | description |
---|---|---|---|
className | String | "" |
Set the `SearchBox` className. |
style | Object | {} |
Set the `SearchBox` style prop. |
defaultValue | String | ||
value | String | ||
size | String | "default" |
There are three valid values: "small" , "default" and "large" . |
disabled | Boolean | false | |
placeholder | String | ||
onChange | Function | When the value of the search input is modified, this function will be called. | |
onSearch | Function | When press the Enter key, this function will be called. |
The other props will be as the Ant Design Input
's props.
Development
npm install
npm start
Test Case
npm test
npm run chrome-test
Coverage
npm run coverage
open coverage/ dir
License
antd-search-box is released under the MIT license.