Member Properties

Map object properties to component features using member attributes:

AttributeTypeDefaultDescription
value-memberstring-Property name for extracting unique ID/value from items
display-value-memberstring-Property name for extracting display text from items
search-value-memberstring-Property name for extracting searchable text from items
icon-memberstring-Property name for extracting icon/emoji from items
subtitle-memberstring-Property name for extracting subtitle/description from items
group-memberstring-Property name for extracting group name from items
disabled-memberstring-Property name for determining if item is disabled

Value Formatting

Control how selected values are serialized:

AttributeTypeDefaultDescription
value-format'json' | 'csv' | 'array''json'Format for serializing selected values. See Value Format examples

Note: The getValueFormatCallback property (not HTML attribute) allows custom serialization logic.

Form Integration

Configure HTML form integration with hidden inputs:

AttributeTypeDefaultDescription
namestring-HTML form field name for hidden input(s). See Form Integration examples

Hidden inputs are created automatically and use the format specified by value-format.

Boolean Options

Enable or disable features:

AttributeTypeDefaultDescription
multiplebooleantrueAllow multiple selections
enable-searchbooleantrueEnable search/filtering functionality
allow-groupsbooleantrueEnable grouping of options
show-checkboxesbooleantrueShow checkboxes next to options
sticky-actionsbooleantrueKeep action buttons fixed at top of dropdown
close-on-selectbooleanfalseClose dropdown after selecting an option
lock-placementbooleantrueLock dropdown placement after first open
allow-add-newbooleanfalseAllow adding new options not in the list
show-counterbooleanfalseShow counter next to toggle icon
keep-options-on-searchbooleanfalseKeep all options visible during search (used with search-mode='navigate')
should-keep-search-on-closebooleanfalseKeep search text when closing dropdown
enable-badge-tooltipsbooleanfalseEnable tooltips on selected item badges. See Advanced Features
show-debug-infobooleanfalseDisplay debug information panel showing component state (development tool)

Text Options

Customize text labels and messages:

AttributeTypeDefaultDescription
search-placeholderstring'Search...'Placeholder text for search input
search-hintstring-Hint text shown above input when focused
empty-messagestring'No results found'Message shown when no results found
loading-messagestring'Loading...'Message shown while loading async data

Note: For count text formatting with i18n/pluralization, use the getCounterCallback property (JavaScript callback: (count: number, moreCount?: number) => string). When moreCount is provided, it's for the "+X more" badge in partial mode.

Display Options

Control visual appearance and layout:

AttributeTypeDefaultDescription
badges-display-mode'badges' | 'count' | 'compact' | 'partial' | 'none''badges'How to display selected items in the badges area
badges-position'top' | 'bottom' | 'left' | 'right''bottom'Where to place badges relative to input
badges-thresholdnumbernullTrigger threshold mode after N selections
badges-threshold-mode'count' | 'partial''count'Behavior when threshold exceeded: 'count' shows counter, 'partial' shows limited badges + more indicator. See Advanced Features
badges-max-visiblenumber3Maximum badges to show in partial mode (used with badges-threshold-mode='partial')
badge-tooltip-placement'top' | 'bottom' | 'left' | 'right''top'Tooltip placement relative to badge (requires enable-badge-tooltips="true")
remove-button-tooltip-textstring'Remove'Tooltip text for badge remove button
search-input-mode'normal' | 'readonly' | 'hidden''normal'Search input display mode
search-mode'filter' | 'navigate''filter'Search behavior: 'filter' hides non-matching, 'navigate' keeps all visible and jumps to matches
actions-layout'nowrap' | 'wrap''nowrap'Action buttons layout: 'nowrap' single row, 'wrap' allows multiple rows

Sizing Options

Control dimensions and limits:

AttributeTypeDefaultDescription
dropdown-min-widthstring (CSS value)-Minimum width for dropdown (e.g., '20rem', '300px')
dropdown-max-widthstring (CSS value)-Maximum width for dropdown (e.g., '30rem', '500px')
max-heightstring (CSS value)'20rem'Maximum height for dropdown options list
min-search-lengthnumber0Minimum characters required before loading data

Note: For input sizing, use CSS classes (ms__input--xs, --sm, --md, --lg, --xl) or the --ms-rem CSS variable. See Custom Styling.

Virtual Scrolling

Optimize performance for large datasets:

AttributeTypeDefaultDescription
enable-virtual-scrollbooleanfalseEnable virtual scrolling for better performance with large lists
virtual-scroll-thresholdnumber100Number of items that triggers automatic virtual scrolling
option-heightnumber40Fixed height (px) of each option for virtual scroll calculations
badge-heightnumber28Fixed height (px) of each badge for virtual scroll in popover
virtual-scroll-buffernumber5Number of extra items to render above/below visible area

Virtual scrolling only renders visible items, dramatically improving performance for lists with thousands of options. See Virtual Scrolling.

Initial Values

Set default selected values:

AttributeTypeDefaultDescription
initial-valuesstring (JSON array)-Initial selected values as JSON array (e.g., '[1,2,3]')

💡 Usage Tips

  • Boolean Attributes: Set to "false" to disable (e.g., multiple="false")
  • Kebab-case: All attributes use kebab-case in HTML (e.g., pills-display-mode)
  • Member vs Callback: Use member attributes for simple property mapping, callbacks for complex logic
  • Initial Values: Must be valid JSON array when using initial-values attribute
  • CSS Values: Sizing attributes accept any valid CSS unit (px, rem, em, %, etc.)