Skip to main content

BwSelect| bw-select

Overview

BwSelect is a form control that allows the user to select one or more options from a list. It can be used as a single select or a multi select. Each item within the select should be a bw-option.

Usage

Default Value

123
<div style="padding-bottom: 8px;">
<bw-select value="1">
<bw-option value="1">1</bw-option>
<bw-option value="2">2</bw-option>
<bw-option value="3">3</bw-option>
</bw-select>
</div>

Disabled

123
<div style="padding-bottom: 8px;">
<bw-select disabled="true">
<bw-option value="1">1</bw-option>
<bw-option value="2">2</bw-option>
<bw-option value="3">3</bw-option>
</bw-select>
</div>

Label

123
<div style="padding-bottom: 8px;">
<bw-select label="Select a value">
<bw-option value="1">1</bw-option>
<bw-option value="2">2</bw-option>
<bw-option value="3">3</bw-option>
</bw-select>
</div>

Multi Select

123
<div style="padding-bottom: 8px;">
<bw-select multiple="true">
<bw-option value="1">1</bw-option>
<bw-option value="2">2</bw-option>
<bw-option value="3">3</bw-option>
</bw-select>
</div>

No Rows

<div style="padding-bottom: 8px;">
<bw-select></bw-select>
</div>

Placeholder

123
<div style="padding-bottom: 8px;">
<bw-select placeholder="value">
<bw-option value="1">1</bw-option>
<bw-option value="2">2</bw-option>
<bw-option value="3">3</bw-option>
</bw-select>
</div>

Properties

PropertyAttributeDescriptionTypeDefault
disableddisabledMakes the input disabled and prevents changesbooleanfalse
errorerrorShows an error icon. If a string is passed in, it will render the icon as a tooltip. Has no effect on form validationanyundefined
interfaceinterfaceThe interface the control will be displayed on"popover" | "sheet"undefined
labellabelLabel that goes above the inputstringundefined
multiplemultipleAllows selecting multiple options and changes the value type to an arraybooleanfalse
notenoteInformational text directly below the controlstringundefined
originalValueoriginal-valueThe default value the control will reset to in a form. If not set, will default to the inital value of the "value" property.string | string[]undefined
pendingpendingShows a loading indicatorbooleanfalse
placeholderplaceholderPlaceholder for the inputstringundefined
readonlyreadonlyMakes the input readonly and prevents changesbooleanfalse
requiredrequiredMarks it as required in a form and shows an asterisk at the end of the labelbooleanfalse
sizesizeSize of the control"lg" | "md" | "sm"'sm'
successsuccessShows a success icon. Has no effect on form validationbooleanfalse
valuevalueThe currently selected value of the controls. Will be a string aray if it's a multiselectstring | string[]undefined

Events

EventDescriptionType
readyEmits once when the component has completed it's initial renderCustomEvent<any>
valueChangeEmits the currently selected values whenever they changeCustomEvent<string | string[]>

Methods

checkValidity() => Promise<boolean>

Checks the validity of the select

Returns

Type: Promise<boolean>

true if the select is valid, false otherwise

reportValidity() => Promise<boolean>

Reports the validity of the select

Returns

Type: Promise<boolean>

true if the select is valid, false otherwise

setCustomValidity(message: string | null) => Promise<void>

Sets the custom validity of the select

Parameters

NameTypeDescription
messagestring- The message to set the custom validity to

Returns

Type: Promise<void>

Slots

SlotDescription
"end"Content placed after selected value/s
"label"The label of the select
"note"The note of the select
"start"Content placed before selected value/s

Shadow Parts

PartDescription
"button"The button of the select
"main"The main div container of the select
"popover"The popover of the select
"sheet"The bottom sheet of the select

CSS Custom Properties

NameDescription
--heightHeight of the select
--input-colorColor of the selected value/s in the main container
--label-colorColor of the label
--padding-inlinePadding inline of the select
--placeholder-colorPlaceholder color of the select

Dependencies

Depends on

Graph


© 2025 United Systems & Software - All Rights Reserved.