React component for a bootstrap-styled selectbox
Find a file
2024-06-26 05:50:58 +02:00
example Release v1.0.0 2022-07-16 04:59:42 +02:00
src Fix misstake of commiting old defaultValueText instead of the correct placeholderText prop; release 1.2.1 2022-12-13 13:45:20 +01:00
.gitignore Fixed packaging; release v1.0.1 2022-07-20 17:15:51 +02:00
LICENSE Release v1.0.0 2022-07-16 04:59:42 +02:00
package.json Update v1.3.0 2024-06-26 05:50:58 +02:00
readme.md Add badges to readme.md 2024-06-26 05:32:14 +02:00
tsconfig.json Release v1.0.0 2022-07-16 04:59:42 +02:00
yarn.lock Move react-bootstrap from a dependency to a peer-dependency 2024-06-26 05:49:45 +02:00

react-bs-selectbox

Npm package version Npm package license Npm package types

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)