0.1.7 • Published 3 years ago

@alex-v/material-ui-react-group-select v0.1.7

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

Group Select

Built on top of the material-ui react 5 Autocomplete Component.

Capabilities:

  • Ability to select a single option from a select.
  • Ability to select n options from grouped options.
  • Ability to select an entire group of options, by selecting the group heading option.
  • Ability to unselect an entire group of options by unselecting the group heading option.
  • Auto-selection of a heading option when a user selects all the sub-options from the group.
  • Auto unselecting of a heading option when a user unselects one of the sub options.
  • Ability to search for specific options.

Install

Install using npm i -S @alex-v/material-ui-react-group-select

Usage

In a React app, use the Button or Badge components:
import GroupSelect from '@alex-v/material-ui-react-group-select'

GroupSelect props

NameDescription
valuesList of selected options
optionspossible options array of objects that can contain title:string, groupId:string - a unique group identifier, groupRef:string - a reference to a groupId
labelAutocomplete label
placeholderAutocomplete placeholder
onChangeCallback fired when the value changes.