DEV Community

loading...

React select

askavy profile image Avnish Jayaswal Originally published at askavy.com Updated on ・1 min read

Original Post
react select

How to install react select using npm

npm install --save react-select

How to use react-select multiselect



import React from "react";
import Select from "react-select";
import "./App.css";

function App() {
  const options = [
    { value: "1", label: "Chocolate" },
    { value: "2", label: "Strawberry" },
    { value: "3", label: "Vanilla" },
  ];

  return (
    <div className="App">
      <Select multi options={options} />
    </div>
  );
}

export default App;
Enter fullscreen mode Exit fullscreen mode

http://askavy.com/

Discussion (0)

pic
Editor guide