Skip to content

Listbox

BsListbox is a component that let users select one or more items from a displayed list.

Added since v2.0.0

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.

Selected value:

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.

Selected values:

Using Checkbox

In multiple selection mode, the checkbox can be enabled via use-checkbox property.

No data to display.
Selected values:

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.

No data to display.
Selected values:

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.

Selected value:

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.

Selected value:

Custom List Items

<bs-listbox> list items can be organized in different ways by providing the custom template option-item slot.

No data to display.
Selected value:

CSS Variables

scss
--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)};

API Reference

Released under the BSD-3-Clause License.