Skip to content

Combo Box - Multi Select

<tpg-combo-box-multiselect></tpg-combo-box-multiselect>

Combo box Multi Select elicits a multi-level list of drop-down choices that can contain values ot itemized options. When the dropdown is empty, the ComboBoxMultiselect will be set to “disabled” with N/A as its content.

Examples

The Combo Box Multi Select also has the same properties/attributes as Text Field. You can check the Text Field page for its available attributes.

Basic Usage

Pass as many options into the Mutliselect Combo Box as you want.

When more than 10 options are put into the combo-box-multiselect, the dropdown menu will automatically become scrollable. The amount of rendered items is determined by maxRenderedOptions prop.

The mutli select combo box is also searchable, and has keyboard navigation.

Default value

Use the selected-values attribute on the Combo Box Multi Select to set the default selected values. The value has to correspond with the value of a Menu Item.

Clear

You can use the clear-button attribute to easily clear the input of Combo Box Multi Select

Read Only

Use the read-only attribute on the Combo Box Multi Select to showcase the value without being able to change it.

Event handling

The Combo Box Multi Select is a controlled component, which means its selection state must be managed externally by your application logic.

When a Menu Item is selected, the component dispatches a tpg-change event. To update the selected values, listen for this event and set the Combo Box Multi Select’s selectedValues property manually based on the event’s payload.

Tables

Properties

Attribute Property Description Type Default Value
options options Array of objects containing items to be listed ComboBoxOption[] []
max-rendered-options maxRenderedOptions Limits how many options are rendered number 100
selected-values selectedValues Values of the currently selected menu items. Can be used to preselect a Menu Item should their values match. string[] []
label label Label of the textfield. string ''
value value The default value on the textfield string ''
message message Message to appear on badge if set. string ''
placeholder placeholder Optional placeholder that is visible if value is empty string ''
type type The type of textfield to render in terms of severity-level. 'default' | 'error' | 'warning' | 'danger' 'default'
clear-button clearButton Flag that includes a button to clear the text if included. boolean false
full-width fullWidth Determines if the dropdown menu scales to its parent (text-field) or if it scales to its largest menu item.. boolean false
disabled disabled Whether or not the combobox is disabled boolean false
leading-icon-template leadingIconTemplate URI-encoded SVG template for the button's icon. Supported constants are found in IconConstant | '' ''
read-only readOnly Whether or not the multi select is read only boolean false
form-associated formAssociated boolean true
name name name property for use in conjunction with html forms string

Events

Event name Reactjs attribute Description
tpg-change ontpg-change Emitted when an item is selected, containing the value identifier of this item.

Functions

Name Description Arguments
No functions found.

Slots

Name Description
Slot menu-items in here.

CSS Parts

Attribute Description
No CSS parts found.

Sandbox