Package Exports
- react-dropdown-cs
- react-dropdown-cs/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-dropdown-cs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Getting started
Compatibility
Your project needs to use React 16.8 or later.
Installation
Add react-dropdown to your project by executing npm install react-dropdown-cs or yarn add react-dropdown-cs.
Usage
Here's an example of basic usage:
import { useState } from 'react';
import "react-dropdown-cs/dist/dropdown.css";
import Dropdown from 'react-dropdown-cs';
function MyApp() {
const [selectedOption, setSelectedOption] = useState(null);
const icons = {
"Dashboard": <FaTachometerAlt />,
"User Settings": <FaCog />,
"Notifications": <FaBell />,
"Profile": <FaUser />,
"Log Out": <FaSignOutAlt />,
"None": <FaTimes />
};
return (
<div>
<Dropdown
options={["Dashboard", "User Settings", "Notifications", "Profile", "Log Out",]}
selected={selectedOption}
onSelect={setSelectedOption}
placeholder="Choose an option"
icons={icons}
/>
</div>
);
}
License
The MIT License.