New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

reactjs-selectdropdown

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactjs-selectdropdown

ReactSelectDropdown is a JS library which is dropdwon with all the features of select element given by HTML.

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

ReactSelectDropdown

ReactSelectDropdown is a JS library which is dropdwon with all the features of select element given by HTML.

Why we need this module

When we use default select of HTML we are not able to modify its CSS completely specially for option menu but this module gives you the feature of select and allow you to set CSS in any way you want it to be.

Installation

npm install --save reactjs-selectdropdown

Usage

import SelectDropdown from 'ReactSelectDropdown';

<SelectDropdown 
  data={data} 
  labelToShow='labelCheck' 
  getData={(data) =>{
    console.log(data)
  }}
  height='200'
  arrowColor='#57a61e'
/>


const data =  [
  { labelCheck: 'A', value: 1 },
  { labelCheck: 'B', value: 2 },
  { labelCheck: 'C', value: 3 },
  { labelCheck: 'D', value: 4 },
  { labelCheck: 'E', value: 5 },
  { labelCheck: 'F', value: 6 },
] or ['A','B','C','D','E','F']

Props

  className: PropTypes.string,
  labelToShow: PropTypes.string,
  getData: PropTypes.func.isRequired,
  data: PropTypes.array.isRequired,
  height: PropTypes.string,
  arrowColor: PropTypes.string,

DefaultProps

  className: '',
  labelToShow: 'label',
  height: 'auto',
  arrowColor: '#000',

Props Explanation

  className: Pass a dynamic class which will apply the css to the wrapper.

  labelToShow: If you are passing array of object then pass the key of the object you want to render.

  getData: This is function which will return the selected value.

  data: This is data which is an array either of string or objects.

  height: Max-height of the dropdown with scroll.

  arrowColor: color of the chevron.

License

ISC

Keywords

select

FAQs

Package last updated on 03 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts