Selector
bp-multi-select

Inputs

Multiselect inputs
InputTypeDescriptionNotes
labelstringThe label text for the multi-select.Required.
isLabelHiddenbooleanDetermines if the label is visually hidden.

Default is "false".

When "true" the label is hidden.

isInlinebooleanDetermines whether to show the label and select inline with each other, or stacked.When "true" the label and select are inline.
optionItemsstring[] | object[]The data used to populate the options of the multi-select.

This can be either an array of strings, or an array of objects.

Individual options can be disabled by adding a key:value pair of disabled:true to the object for that option.

isSearchablebooleanDetermines if the multi-select is searchable.

Default is "false".

When "true" the multi-select is searchable.

hasTagsbooleanDetermines if the multi-select has tags instead of "_ out of _ selected" text.

Default is "false".

When "true" the multi-select shows the selected options with tags.

When "false" the multi-select shows the selected options with "_ out of _ selected" text.

placeholderstringThe placeholder text for the multi-select.
bindValuestringObject property to use for selected model.By default binds to whole object.
bindLabelstringObject property to use for label.Default is "label".
maxSelectedItemsnumberSets the total number of options that can be selected at once.
groupBystring | FunctionGroups the options by a key or a function expression.
selectableGroupbooleanDetermines if the group is selectable when groupBy is used.

Default is "true".

When "true" the group is selectable.

selectableGroupAsModelbooleanDetermines if selecting all the children or the group itself.

Default is "false".

When "true" the group itself is selected.

When "false" the group children are selected.

isDisabledbooleanDetermines if the multi-select is disabled.

Default is "false".

When "true" the multi-select is disabled.

When disabled, the form control is not editable, and the data will not be submitted.

isReadonlybooleanDetermines if the multi-select is readonly.

Default is "false".

When "true" the multi-select is readonly.

When readonly, the form control is not editable, and the data will be submitted.

inputAttrsobjectPasses custom attributes to the underlying input element through key:value pairs.
bpIDstringThe value for the multi-select's id attribute.

Ids must only be used once per page.

Ids should be camelCase, e.g.: #myId.

See identifiers.

Internationalization

Multiselect internationalization input
KeyTypeDescriptionNotes
'+ additional more'stringThe text used for the overflow tag text.Default is "+ #{additional} more".
'numSelected out of numTotal selected'stringThe text used for the selected placeholder text.Default is "#{numSelected} out of #{numTotal} selected".
'No items found'stringThe text that displays when search returns no results.Default is "No items found".

Outputs

Multiselect outputs
OutputDescription
ngModel Exposes the ngModel of the select. Reflects the current selection in the form of an array of the selected values.
valueChange Whenever the selection is updated, an array of the selected values will be emitted.

Content Projection

The ng-multi-label-tmp and ng-option-tmp attributes are the values for the optional ng-content directives' select attributes.

ng-multi-label-tmp

Used to create a custom placeholder that can utilize the selected items array and clear function.

<bp-multi-select
  label="Label Text"
  ...
>
  <ng-template ng-multi-label-tmp let-items="items" let-clear="clear">
    <span>Selected {{ items.length }} items</span>
  </ng-template>
</bp-multi-select>

ng-option-tmp

Used to create a custom template for options. An example use case would be adding icons to statuses. The template replaces content to the right of the checkbox. The option item and index are exposed and can be used.

<bp-multi-select
  label="Label Text"
  ...
>
  <ng-template ng-option-tmp let-item="item" let-index="index">
    <span class="status-icon complete"></span> {{ item }}
  </ng-template>
</bp-multi-select>

Identifiers

Identifiers
IDDescription
bpIDThe unique identifier for the multi-select component.
bpID + 'Select'The unique identifier for the multi-select.