All Projects → elsangedy → use-downshift

elsangedy / use-downshift

Licence: MIT license
use-downshift.now.sh

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to use-downshift

Vue Treeselect
A multi-select component with nested options support for Vue.js
Stars: ✭ 2,347 (+6076.32%)
Mutual labels:  select
Angular2 Multiselect Dropdown
Angular 2 Dropdown Multiselect
Stars: ✭ 225 (+492.11%)
Mutual labels:  select
Teaset
A UI library for react native, provides 20+ pure JS(ES6) components, focusing on content display and action control.
Stars: ✭ 2,845 (+7386.84%)
Mutual labels:  select
Vue Cool Select
Select with autocomplete, slots, bootstrap and material design themes.
Stars: ✭ 195 (+413.16%)
Mutual labels:  select
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+6144.74%)
Mutual labels:  select
React Native Dropdown Picker
A single / multiple, categorizable & searchable item picker (dropdown) component for react native which supports both Android & iOS.
Stars: ✭ 230 (+505.26%)
Mutual labels:  select
Dropkick
A JavaScript plugin for creating beautiful, accessible, and painless custom dropdowns.
Stars: ✭ 1,946 (+5021.05%)
Mutual labels:  select
tagselector
Dependency-free JS library that turns select fields in customizable tag clouds
Stars: ✭ 19 (-50%)
Mutual labels:  select
Ant Plus
🔺 Ant Design 表单简化版
Stars: ✭ 212 (+457.89%)
Mutual labels:  select
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+7218.42%)
Mutual labels:  select
Lightweightrunloop A Reactor Style Nsrunloop
NSRunLoop Reactor Style Implementation: Using BSD kqueue implements iOS/Mac NSRunLoop and RunLoop-Relative Foundation such as perform selector(or delay some times) on other thread , Timer, URLConnection ,LWStream(LWInputStream、LWOutputStream) , LWPort(LWSocketPort) etc.
Stars: ✭ 196 (+415.79%)
Mutual labels:  select
Jcf
Advanced form elements customization using CSS/JS
Stars: ✭ 203 (+434.21%)
Mutual labels:  select
Tail.select
Create beautiful, functional and extensive (Multi) Select Fields with pure, vanilla JavaScript.
Stars: ✭ 235 (+518.42%)
Mutual labels:  select
Selectize.js
Selectize is the hybrid of a textbox and <select> box. It's jQuery based, and it has autocomplete and native-feeling keyboard navigation; useful for tagging, contact lists, etc.
Stars: ✭ 12,744 (+33436.84%)
Mutual labels:  select
vaadin-select
Customizable Web Component similar to a native browser select. Part of the Vaadin components.
Stars: ✭ 18 (-52.63%)
Mutual labels:  select
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (+371.05%)
Mutual labels:  select
React Dropdown Select
Customisable dropdown select for react
Stars: ✭ 227 (+497.37%)
Mutual labels:  select
selectize-bootstrap4-theme
Selectize Theme for Bootstrap 4
Stars: ✭ 43 (+13.16%)
Mutual labels:  select
vue-tags-component
Vue.js 2+ tags component
Stars: ✭ 27 (-28.95%)
Mutual labels:  select
Jquery Flexselect
💪☑️ A jQuery plugin that turns regular select boxes into Quicksilver-like, flex-matching, incremental-finding controls.
Stars: ✭ 236 (+521.05%)
Mutual labels:  select

use-downshift

MIT License downloads PRs Welcome

Installation

$ yarn add use-downshift
# or
$ npm i use-downshift

Usage

import React from 'react'

import useDownshift from 'use-downshift'

const items = [
  {value: 'apple'},
  {value: 'pear'},
  {value: 'orange'},
  {value: 'grape'},
  {value: 'banana'},
]

function MyComponent() {
  const {
    isOpen,
    getRootProps,
    getMenuProps,
    getItemProps,
    getLabelProps,
    getInputProps,
    highlightedIndex,
    inputValue,
    selectedItem
  } = useDownshift({
    onChange: selection => alert(`You selected ${selection.value}`),
    itemToString: item => (item ? item.value : '')
  })

  return (
    <div {...getRootProps()}>
      <label {...getLabelProps()}>{label}</label>
      <input {...getInputProps({ placeholder: 'search...' })} />
      {isOpen && (
        <ul {...getMenuProps()}>
          {items
            .filter(item => !inputValue || item.value.includes(inputValue))
            .map((item, index) => (
              <li
                {...getItemProps({
                  key: index,
                  item,
                  style: {
                    background: highlightedIndex === index ? 'lightgray' : 'white',
                    fontWeight: selectedItem === item ? 'bold' : 'normal',
                  }
                })}
              >
                {item.value}
              </li>
            ))}
        </ul>
      )}
    </div>
  )
}

export default MyComponent

Roadmap

  • move to ts
  • tests
  • ci/cd
  • semantic-release
  • docs
  • all-contributors

Inspiration

downshift

LIENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].