1.0.5 • Published 4 years ago

reactjs-simple-dropdown v1.0.5

Weekly downloads
10
License
MIT
Repository
-
Last release
4 years ago

React Simple Dropdown

Simple React.js dropdown toolkit.

Installation

You can easily install it with npm:

npm install react-simple-dropdown

How to use

This module provides following key factors:

  • handleSelectOption: The element that will cause your dropdown to appear when clicked.
  • handleOptionList: The selected element from multiple dropdown options can be viewed and then the dropdown menu get hidden.
  • SimpleDropdown: The base element for your dropdown. This contains both the handleSelectOption and the handleSelectOption, and handles communication between them.

Here's a quick example:

import React from 'react';
import SimpleDropdown from './main/SimpleDropdown';

function App() {

  const optionList = ['Mango', 'Banana', 'Apple', 'Grapes'];

  return (
      <SimpleDropdown 
      Label='Select Fruit'
      optionList={optionList}
      />
  );
}

export default App;

OptioptionListons

optionList can be passed to SimpleDropdown as props. A list of available options can be found below. These must be passed to the containing SimpleDropdown component.

Label

Lable can be passed to SimpleDropdown as props. Label is the heading which can be given to the Dropdown.