0.0.6 • Published 3 years ago

react-simple-filter-list v0.0.6

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

React simple filter list

This is a simple filter list with virtual scrolling

How to use

import { SimpleList } from "react-simple-filter-list";


function App() {
  const [myList, setMyList] = useState([]);
  return (
    <div className="App">
      <SimpleList itemList={myArr} onItemSelected={(list) => setMyList(list)} />
      <ul>
        {myList.map((item) => (
          <li key={item.key}>{item.value}</li>
        ))}
      </ul>
    </div>
  );
}

API

props

PropertyDescriptionTypeDefault
sizeSet select sizesmall medium largesmall
itemListA list that you'd like to renderarray[]
onItemSelectedReturns currently selected itemsfunction