gousta / react-tachi-select

React, Typescript, Select, Fast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-tachi-select

A React Select that works really well with a huge amount of data

NPM JavaScript Style Guide

Install

npm install --save react-tachi-select
-- OR --
yarn add react-tachi-select

Usage

import * as React from "react";

import ReactTachiSelect from "react-tachi-select";

class Example extends React.Component {
  state = {
    selectedValue: ""
  };

  handleChange = (value) => {
    this.setState({ selectedValue: value });
  };

  render() {
    const data = [
      {
        value: 1,
        label: "Option 1",
        searchable: "option 1"
      },
      {
        value: 2,
        label: "Option 2",
        searchable: "option 2"
      },
      {
        value: 3,
        label: "Option 3",
        searchable: "option 3"
      }
    ];
    return <ReactTachiSelect data={data} onChange={this.handleChange} />;
  }
}

License

MIT © gousta

About

React, Typescript, Select, Fast


Languages

Language:TypeScript 66.5%Language:JavaScript 23.5%Language:HTML 8.8%Language:CSS 1.2%