Listbox
BsListbox is a component that let users select one or more items from a displayed list.
Overview
BsListbox component mimics the HTML List Box: <select size="number">
element. This means that you can add attributes like readonly
, or disabled
and it will react to them to give the best experience. You can also use v-model
directive to create two-way data bindings on the model-value
property.
IMPORTANT
Do not use the model-value
property when using v-model
.
Multiple Selection
<bs-listbox>
support multiple selection. Multiple selection mode feature can be enabled using the multiple
property explicitly.
Using Checkbox
In multiple selection mode, the checkbox can be enabled via use-checkbox
property.
Checkbox Position and Color
In multiple selection mode, the checkbox color can be changed via checkbox-color
property and the position can be changed via checkbox-position
property. Valid values for this property are: left
(default), right
. If these property is not defined, then default value will be used.
TIP
Any MDBootstrap Color variants and Material Color variants can be applied to the checkbox-color
property.
Image Support
<bs-listbox>
component supports displaying images or avatars. This feature can be enabled using the show-image
property explicitly and use the imageField
property on the configuration schema to point to the image field in the datasource. By default, the value of property imageField
is set to image
.
Image Size And Shape
The size of images can be controlled via image-size
property. Sets this property to the desired numbers of pixels and the image will displayed according to this value. And use rounded-image
or circle-image
property to change its shape.
Custom List Items
<bs-listbox>
list items can be organized in different ways by providing the custom template option-item
slot.
CSS Variables
--md-searchbox-padding-x: 0.75rem;
--md-searchbox-padding-y: 0.5rem;
--md-searchbox-border-color: #{$gray-500};
--md-searchbox-focused-border-color: #{$default-active-bgcolor};
--md-searchbox-font-size: 14px;
--md-searchbox-text-color: #{$gray-900};
--md-searchbox-focused-shadow-rgba: #{rgba($default-active-bgcolor, 0.2)};