Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Add import definition and shouldRenderItem example to README #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# React Autocomplete [![Travis build status](https://travis-ci.org/reactjs/react-autocomplete.svg?branch=master)](https://travis-ci.org/reactjs/react-autocomplete/)

Accessible, extensible, Autocomplete for React.js.
```javascript
import Autocomplete from 'react-autocomplete'
```

```jsx
<Autocomplete
Expand All @@ -10,6 +13,7 @@ Accessible, extensible, Autocomplete for React.js.
{ label: 'banana' },
{ label: 'pear' }
]}
shouldItemRender={(item, value) => item.label.includes(value)}
renderItem={(item, isHighlighted) =>
<div style={{ background: isHighlighted ? 'lightgray' : 'white' }}>
{item.label}
Expand Down