@bithero/react-bs-selectbox
v1.3.0
Published
React component for a bootstrap-styled selectbox
Downloads
16
Maintainers
Readme
react-bs-selectbox
React component for a bootstrap-styled selectbox
License
This project is licensed under AGPL-3.0. See the LICENSE
file for more informations.
Usage
import { BsSelectbox, ISelectBoxOption } from '@bithero/react-bs-selectbox';
const MySelectbox = () => {
const options: ISelectBoxOption[] = [
{ value: 'red', label: 'Rot' },
{ value: 'blue', label: 'Blau' },
];
return (<BsSelectbox options={options} multiple/>);
}
Props
Prop | Type | Comment
--------------------|-------------------------------|------------------------------------------------
multiple | boolean
| If true, the selectbox allow multi-select
options | ISelectBoxOption[]
| An array of options this selectbox should have available
isLoading | boolean
| If true, shows a simple loading spinner
disabled | boolean
| If true, the component disallows any input
selection | ISelectBoxOption[]
| Provides an array of options that are currently selected; in single mode this should only contain one element
onSelectionChange | (ISelectBoxOption[]): void
| Called when the selection of the component is about to change
placeholderText | ?string
| If set, this replaces the 'Please select an option' text
className | string
| React-className; forwarded to the most outer component (the dropdown)
styles | CSSProperties
| React-styles; forwarded to the most outer component (the dropdown)