Select
A generic and easy to use select control that encompasses common behaviour and style across all apps.
It uses the react-select library and it supports multi selects and creatable selects.
Properties#
labelProps:objectofpropsrelated to the label, they will be passed to the underlyingControlLabelcomponent. If not provided, theControlLabelwill not be displayed.creatable: If set to true, new options can be created on the fly by the user. Note : We useCreatableSelectinstead ofSelectas the underlying select component. The same props or passed to both components.isMulti: See react-selectvalue: See react-selectonChange: See react-selectoptions: See react-selectcloseMenuOnSelect: See react-selectisClearable: See react-selectplaceholder: If defined, it is sent as the placeholder props to the underlying component. If the label props is defined, it will be used as a default placeholderSelect a ${props.label}. If no placeholder or label is defined, then nothing is sent as the placeholder to the underlying component.label: If the label props is defined but no placeholder is defined, it will be used as a default placeholderSelect a ${props.label}. If no placeholder or label is defined, then nothing is sent as the placeholder to the underlying component.isDisabled: See react-selectmenuPlacement: See react-selectmenuPosition: See react-selectstyles: react-select styles object to override the default styles. See react-select
PropTypes#
Select.propTypes = { labelProps: shape({...ControlLabel.propTypes}), creatable: bool, isMulti: bool, value: any, onChange: func, options: array, closeMenuOnSelect: func, isClearable: bool, placeholder: string, label: string, isDisabled: bool, menuPlacement: string, menuPosition: string, styles: object}