โ† Back to Examples

๐Ÿ“ฆ Classic Examples

Traditional multiselect demos showing basic functionality and common use cases.

โœจ Declarative Usage (No JavaScript Required!)

Use standard HTML <option> elements - no JavaScript needed for simple cases! The component reads value, selected, and data-* attributes from each option.

No JavaScript required - pure HTML!
Icons via data-icon attribute
Use <optgroup> for grouping
Use data-subtitle for descriptions
Using renderGroupLabelContentCallback to customize group headers

Single-Select Mode

Only one item can be selected at a time. Use multiple={false}

Only one language can be selected

Single-Select: Keyboard Navigation Only

No search - use arrow keys, PageUp/PageDown, Home/End to navigate. Press Enter to select.

Try: โ†‘/โ†“ arrows, PageUp/Down (10 items), Home/End, Enter to select

Basic MultiSelect

Simple multiselect with basic options

Select multiple programming languages
Start typing to filter options

Rich Content with Icons

Options with icons, subtitles, and multiline content

Options with icons and descriptions

Search Hint

Display helpful text above the input to guide users

Open the dropdown to see the hint above the input

Display Modes

Different ways to display selected items

Basic Display Modes

Shows each selection as a removable badge
Shows "X selected" text with clear button
First item + count in single badge: "JavaScript (+2 more)"
Shows first 3 badges + "+X more" badge (when >5 selected)
No badges shown - only [X] badge next to toggle

Display Mode + Counter Combinations

Individual badges + [X] badge
"X selected" text + [X] badge (double count display)
First item + count badge + [X] badge

Threshold Auto-Switching

Badges when โ‰ค3, switches to count when >3
Badges when โ‰ค5, shows 3 badges + "+X more" when >5

Internationalization (i18n)

"1 item selected" vs "3 items selected"
1 poloลพka | 2-4 poloลพky | 5+ poloลพek
Shows "+X mรกs" instead of "+X more"

Badge Tooltips

Display helpful tooltips when hovering over selected item badges

Hover over badges to see default tooltip
Shows custom tooltip with description
Tooltip appears below the badge
Faster tooltip appearance (default is 300ms)

Badge Positioning

Control where selected badges appear relative to the input: badges-position

Badges appear below the input (default)
Badges appear above the input
Badges appear inline to the left of input
Badges appear inline to the right of input

Inline Vertical Alignment

Control vertical alignment for left/right badge positions with --ms-inline-align

--ms-inline-align: center
--ms-inline-align: flex-start
--ms-inline-align: center
--ms-inline-align: flex-start

RTL (Right-to-Left) Support

Full support for RTL languages (Arabic, Hebrew, Persian, etc.) with automatic detection from dir="rtl"

Toggle on left, text right-aligned, badges flow right-to-left
Real Arabic technology terms
Count badge on left side in RTL mode
LTR (Left-to-Right)
RTL (Right-to-Left)
Notice toggle position, text alignment, and badge layout differences
Badges inline on left (visually) with proper margin
Badges inline on right (visually) with proper margin

Async Search / Lookup

Load options dynamically as users type. Perfect for large datasets, API searches, or real-time filtering.

Tries GitHub API, uses mock data if rate-limited
Simulated product database search
Initial favorites + full search on typing (type at least 2 characters)

Initial Options + Async Search Pattern:

The Security Groups example demonstrates a common UX pattern:

  • Initial State: Shows 5 most frequently used security groups when dropdown opens
  • On Typing: Calls server API to search ALL security groups (after 2+ characters)
  • On Clear: Returns to showing the 5 initial favorites
  • Configuration: options (initial data) + searchCallback (async) + keep-options-on-search="true" + min-search-length="2"

Search Modes: Filter vs Navigate

Choose between filter mode (hide non-matches) or navigate mode (jump to matches while keeping all visible)

Hides non-matching options (standard behavior)
Keeps all options visible, jumps to matches (highlighted with left border)

When to use each mode:

  • Filter Mode: Large lists where you want to narrow down options (e.g., product catalogs, user lists)
  • Navigate Mode: Quick selection from known lists (e.g., country/state selectors)

Navigate-mode keyboard shortcuts:

  • type โ€” first match becomes focused; all matches keep a left-border highlight
  • Ctrl/Cmd + โ†“ โ€” jump to next match
  • Ctrl/Cmd + โ†‘ โ€” jump to previous match
  • โ†‘ / โ†“ โ€” move focus one option at a time
  • Home / End โ€” jump to first / last option
  • PageUp / PageDown โ€” move 10 options at a time
  • Enter โ€” toggle selection of the focused option
  • Esc โ€” clear the search (or close the dropdown if search is empty)

Event Handling

Listen to select, deselect, and change events

Open browser console to see events
Event log will appear here...
Looking for the on* property handlers and the beforeSelect/beforeDeselect interceptors? See Events, Handlers & Interceptors.