react-filterable
Easy filtering component for React (ES6)
Usage
Import the following nodes:
import Filter Collection ToggleButton from 'react-filterable';
Add in the Filter
, Collection
and other controls into your component's render()
function:
{ <Filter => <ToggleButton ="includesABC" ="name" ="ABC"> Includes 'ABC' </ToggleButton> <ToggleButton ="includesDEF" ="name" ="DEF"> Includes 'DEF' </ToggleButton> <Collection =/> </Filter>}
The MyComponent
component will receive a prop named collection
that contains the filtered items. Iterate over the items as usual to render them:
MyComponent
{ var collectionNodes = ; thispropscollection; return <div> collectionNodes </div> ;}