1.2.1 • Published 1 year ago

@bithero/react-bs-selectbox v1.2.1

Weekly downloads
-
License
AGPL-3.0-or-later
Repository
-
Last release
1 year ago

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

PropTypeComment
multiplebooleanIf true, the selectbox allow multi-select
optionsISelectBoxOption[]An array of options this selectbox should have available
isLoadingbooleanIf true, shows a simple loading spinner
disabledbooleanIf true, the component disallows any input
selectionISelectBoxOption[]Provides an array of options that are currently selected; in single mode this should only contain one element
onSelectionChange(ISelectBoxOption[]): voidCalled when the selection of the component is about to change
placeholderText?stringIf set, this replaces the 'Please select an option' text
classNamestringReact-className; forwarded to the most outer component (the dropdown)
stylesCSSPropertiesReact-styles; forwarded to the most outer component (the dropdown)