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

material-ui-dropdown

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

material-ui-dropdown

A dropdown list based on @material-ui/core.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

Material UI Dropdownlist

A @material-ui helper to cut off the whole boilerplate to work with select component from @material-ui.

Getting started

Install material-ui-dropdownlist

  • npm install material-ui-dropdownlist or
  • yarn add material-ui-dropdowlist

Import material-ui-dropdowlist into your application import MuiDropdownList from "material-ui-dropdowlist";

Setting up the dropdown

<MuiDropdownList defaultText="Select item..." options={persons} placeholder="Persons" optionText="name" optionValue="id" value={this.state.value} onChange={this.handleChange} showError={this.state.showError} errorText={this.state.errorText} />

defaultText: Text that will appear as default option (empty value) options: Array of available options - Options should be an object with properties to be used as option text and option value placeholder: Dropdown's placeholder optionText: String - Property from the object in options that you want to be displayed optionValue: String - Property from the object in options that you want to be the value (normally the object ID) value: String - Selected item onChange: Function - Callback you want to executed when an item is selected. - Returns the selected object showError: Boolean - Change dropdown's color to red, indicating error. errorText: String - Error message you want to display

In addition you can use all properties from Material TextField to customize your dropdown

P.S.: This dropdown does not accept multiple selection (maybe in the future)

Keywords

react

FAQs

Package last updated on 09 Jun 2018

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