react-sweet-search as React components
React based component Search. Enhance user experience of search.
Install via npm
Step 1:
npm install --save react-sweet-search
Step 2:
- include node_module/react-sweet-search/dist/css/SweetSearch.css
import React from 'react';
import ReactDOM from 'react-dom';
import SweetSearch from "react-sweet-search";
const searchFn = function(inputValue, endSearch) {
console.log('inputValue: ' + inputValue);
endSearch();
}
const cancelFn = function (endSearch) {
// always needs to cancel searching
endSearch();
}
ReactDOM.render(
<div>
<SweetSearch search={searchFn} cancel={cancelFn} />
</div>,
document.getElementById("react")
);
Designer: Bill Chen (tw0023156@gmail.com)
Coder: smallma(s.rain@yahoo.com.tw)
MIT