Listbox and Multi-Select
A listbox presents selectable options with single- or multi-selection behavior, while multi-select patterns must also make the full selection set manageable and clear.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/listbox-and-multi-select/
01What it means
A listbox is a composite widget containing a flat list of options from which users select one or more values. It may stay visible or appear within another component. Multi-select adds independent selection state, range or select-all behavior, and a representation of chosen values. Unlike a general list or grid, listbox options cannot contain separately operable controls.[1][2]
02Why it matters
Selection patterns affect how quickly people can compare options, understand what is chosen, and revise a large set. Explicit focus and selection rules prevent keyboard movement from unexpectedly changing values or assistive technologies from flattening rich interactive content into misleading options.
03When to use it
Use a listbox when several options benefit from visible scanning or application-style arrow-key selection, and multi-select when choosing several values is central. Use checkboxes for a small visible set, a native select for simple single choice, a combobox for filtered text entry, and a grid when each row contains independent controls.
04How it works
- Define whether selection is single or multiple and whether focus movement also changes selection.
- Use concise option names, logical grouping, and type-ahead or filtering for longer sets.
- Keep keyboard focus visually distinct from selected state and expose each state programmatically.
- For multi-select, show the chosen set and provide clear individual removal, select-all, and clear-all behavior where useful.
- Test keyboard models, screen-reader output, long lists, virtualization, empty results, touch targets, and preserving selections.
05A practical example
A permissions tool shows a searchable multi-select listbox of teams. Arrow keys move focus without clearing earlier choices, Space toggles the focused team, a summary reports “4 teams selected,” and Clear all is a separate labeled button rather than an ambiguous icon inside an option.
06Where it breaks
Custom listboxes have complex focus and selection behavior, long option names are difficult for screen-reader users, and hidden multi-select menus can obscure the chosen set. Very large lists need careful filtering and virtualization support.
Common mistakes
- Putting links, buttons, or checkboxes with independent behavior inside listbox options.
- Making keyboard focus and selected state visually indistinguishable.
- Clearing prior selections when users navigate without a modifier key.
- Summarizing many selections as a count with no practical way to review or remove them.