npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-material-ui-super-select

v1.1.18

Published

Upgraded select drop down using the Material UI theme

Downloads

11

Readme

React Material UI Super Select

Select drop down field that uses the beautiful stylings of Material UI, but adds option for multi select and creatable select.

The functionality of this select box was inspired by react-select.

Installation and use

npm install -s react-material-ui-super-select

The package exports Select, MultiSelect, and Creatable.

Example use :

import React from 'react';
import { Select } from 'react-material-ui-super-select';

class App extends React.Component {
  state = {
    value: null,
    options: [
      { id: '1', label: 'One' },
      { id: '2', label: 'Two' },
      { id: '3', label: 'Three' },
    ],
  };

  render() {
    return (
      <Select
        label='Select'
        options={this.state.options}
        handleChange={value => this.setState({ value })}
        handleClearValue={() => this.setState({ value: null })}
        selectedValue={this.state.value}
        containerClassName="select-container"
      />
    );
  }
}

Demo

To run the demo project :

  • Navigate to root directory of project
  • Enter npm install
  • Once finished installing, enter npm start
  • When the server starts, navigate to http://localhost:8080

Navigate to example/src to modify the demo app

Props

Name | Data Type | Default | Description --- | --- | --- | --- | options| Array<{ id: String, label: string }> | | required - Used to render the options list. Only label will be displayed. id MUST be unique among the other elements in the list selectedValue | { id: String, label: String } or Array<{ id: String, label: String}> | null | For the Select component, this must be an object that matches one of the objects in the options prop. For the MultiSelect and Creatable components, this must be an array of objects that each match objects in the options prop. containerClassName | String | | Concatenated className to the component's outer <div> handleInputChange | Function | | Called with the user's input when the input is changed handleChange | Function | | Function called when an option is selected. In the Select component, the handleClearValue | Function | | Function called when the clear button is clicked MenuItem | Node | | Optional component to render in place of the default menu item. Will receive a prop named option, which will be the option that is being rendered stayOpenAfterSelection | Boolean | false | If set to true, the menu will stay open after a selection has been made placeholder | String | | The input field's placeholder label | String | | The input field's label loading | Boolean | false | If true, a progress spinner will appear in place of the clear button, and functionality will be disabled. disabled | Boolean | false | If true, all functionality will be disabled, and select field will be read-only manual | Boolean | false | Under the hood, this package filters the visible options based on user input. If manual is true, the component won't do any filtering, and all management of options filtering will need to be done manually. hideLabel | Boolean | false | If set to true, the label will be hidden handleCreate | Function | | Only applicalble for the Creatable component; called after a user hits 'Enter' to create a new option