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-select-input

v1.0.5

Published

react-select-input React component

Downloads

77

Readme

react-select-input

Travis npm package GitHub license

A simple combination of traditional HTML5 input and select.

v2 underway!

I've left this project inactive for way too long (v1.0.0 was launched a year after initial release!). Going through the code, there are a lot of stuff that could be improved. For all the users, the entire project will undergo a complete rewrite. Many of these changes will be breaking, leading up to the release of v2.

Head over to the Version 2 thread to know more and discuss!

Props Overview

InputSelect.defaultProps = {
  uniqueKey: 'react-select-input', //String
  style: null, //Object
  value: '', //String
  valueKey: 'value', //String
  labelKey: 'label', //String
  placeholder: 'Enter text', //String
  className: '', //String
  openUp: false, //Boolean
  disableEnter: true, //Boolean
  collapseOnBlur: true, //Boolean
  collapseOnEscape: true, //Boolean
  collapseOnSelect: true, //Boolean
  autoFocus: true, //Boolean
  clearable: true, //Boolean - NO EFFECT
  options: [], //Array
  onSelect: undefined, //Function (option)
  onClear: undefined, // Function
  onChange: undefined, //Function (event)
  onFocus: undefined, //Function (event)
  onBlur: undefined, //Function (event)
  onKeyUp: undefined, //Function (event)
  onKeyDown: undefined, //Function (event)
  noOptions: undefined //JSX
};

Options

| Prop | Type | Default | | ---------------- | :-----: | --------------------------------------------------------------------------------------------- | | uniqueKey | String | "react-select-input" Unique key for the component. | | style | Object | null Any custom inline styles that need to be passed. | | value | String | "" The value to either populate or control the component. | | valueKey | String | "value" The key from your options which you want to use as the value key. Should be unique. | | labelKey | String | "label" The key from your options for pretty display of options. | | placeholder | String | "Enter text" Placeholder for input. | | className | String | "" Custom classes apart from the default classes to the wrapper. | | openUp | Boolean | false Whether the select should work as a dropup or dropdown. | | disableEnter | Boolean | true If the default return key behaviour should be preserved. | | collapseOnBlur | Boolean | true Clicking outside the ref should collapse the select. | | collapseOnEscape | Boolean | true While focused, hitting Escape collapse the select. | | collapseOnSelect | Boolean | true Upon selection collapses the select. | | autoFocus | Boolean | true On mount, focus the input field. | | clearable | Boolean | true Show an icon to clear the entire select. | | options | Array | [ ] Array of options to use while rendering the list. | | noOptions | JSX | undefined JSX to render when no option matches search. |

Methods

| Prop | Parameters | Description | | --------- | :--------: | --------------------------------------------------------------------------------------------- | | onChange | event | Synthetic event of the input upon change. | | onSelect | option | The selected option.Gets triggered during both clicking and arrow navigation selection. | | onFocus | event | Synthetic event of the input upon focus. | | onBlur | event | Synthetic event of the input upon blur. Native function passed. | | onKeyUp | event | Synthetic event of the input upon keyUp. | | onKeyDown | event | Synthetic event of the input upon keyDown. | | onClear | none | A callback after clear if clearable. |

Copyright © 2018.