Skip to main content

Multiselect

Description

<jp-multiselect> is a field component with multi <select> functionality.


Attributes

NameRequiredTypeDescription
optionsArray<{ label?: string; value:
string; selected?: boolean;
disabled?: boolean }>
select options
valuestring or Array<string>value setter
minSelectsnumberminimum number of selects allowed
minselectsValidationMessagestringvalidation message for when component does not satisfy minselects
maxSelectsnumbermaximum number of selects allowed
maxselectsValidationMessagestringvalidation message for when component does not satisfy maxselects
requiredbooleandetermines if a selection is required
requiredValidationMessagestringvalidation message for when component does not satisfy required
disabledbooleandetermines if a selection is disabled
idstringunique identifier
namestringname of the form control
labelstringshows at the top of the field
labelType'outside' or 'inside'whether label is inside or outside of the field
hintstringshows below the field
validationMessages{[type]: string} where type is stringcompact way of writing validation messages in a single attribute


Slots

This component does not have any slots.



Methods

  • getValue
    • returns form field value
  • reportValidity
    • triggers reportValidity


Events

  • value
    • triggers when one of the selections changes value


Demo

Live Editor
// import '@jaspero/web-components/multiselect.wc.js';
// import '@jaspero/web-components/multiselect.css';

<jp-multiselect
  options='[{"value":"aaa"}, {"value":"bbb"}, {"value":"ccc"}]'
  label="Multiselect"
></jp-multiselect>
Result
Loading...