charity-base-search
Version:
React component for CharityBase search input
64 lines (49 loc) • 1.38 kB
Markdown
# CharityBase Search Component
[![Travis][build-badge]][build]
[![npm package][npm-badge]][npm]
[![Coveralls][coveralls-badge]][coveralls]
[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
[build]: https://travis-ci.org/user/repo
[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
[npm]: https://www.npmjs.org/package/npm-package
[coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square
[coveralls]: https://coveralls.io/github/user/repo
## Issues
* sync filters do not come up straight away when typing new search
## Install
With Yarn:
```bash
yarn add charity-base-search
```
Or npm:
```bash
npm install --save charity-base-search
```
Make sure you have the peer dependencies installed too:
```json
{
"prop-types": "15.x",
"react": "^16.8.0"
}
```
## Example
```jsx
import CharityBaseSearch from 'charity-base-search'
const CHARITY_BASE_API_KEY = 'YOUR_API_KEY' // get yours from https://charitybase.uk/api-portal/keys
const Demo = () => (
<div style={{ fontFamily: 'sans-serif' }}>
<h1>CharityBase Search Demo</h1>
<div style={{
width: '600px',
}}>
<CharityBaseSearch
apiKey={CHARITY_BASE_API_KEY}
label='Search charities'
onSelect={item => {
console.log(item)
}}
/>
</div>
</div>
)
```