Getting startedComponentsDesign tokensThemingTheme synthesizerFrameworksAccessibilityUtilitiesServer renderingBrowser supportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting startedFrameworksServer renderingDesign tokensThemingTheme synthesizerTypographyUtilitiesAll componentsAccessibilityBrowser supportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Combobox

A text input that filters a list of options as you type, for picking one value from a long list.

ComponentsCombobox
inputinteractive
<arc-combobox>

Overview

Combobox is a text input over a list of `<arc-option>` elements. Typing narrows the list to options whose text contains the query, ignoring case. Picking an option, by click or by Enter on the highlighted one, closes the list, puts the option's text in the input and fires `arc-change` with its value. Every keystroke fires `arc-input` with the query. Use it when the list is too long to scroll through but the value has to be one of the options, such as a country field. There's no free-text entry. Each `<arc-option>` needs a `value`, and its text content is the label that's shown and searched. The component renders its own copy of each option and hides the ones you wrote.

Guidelines

Do

  • Give every option a distinct `value`. Selection is tracked by value
  • Write a placeholder that says the field is searchable, such as "Search countries..."
  • Set `label`. It renders above the input and is the accessible name

Don't

  • Don't use it for a handful of options. A Select is quicker
  • Don't put anything but `<arc-option>` in the slot. Other elements are ignored

Features

  • The input has `role="combobox"` with `aria-expanded`, `aria-controls` and `aria-activedescendant`, and the list is a `listbox` of `option` elements
  • Arrow Down and Arrow Up move the highlight, Enter selects and Escape closes. Home and End move the highlight only while the input is empty
  • Disabled options are dimmed, skipped by the arrow keys and can't be selected
  • Shows "No results found" when nothing matches the query
  • Clicking outside or moving focus away closes the list
  • Form-associated: give it a `name` and the selected value submits with the form
  • `readonly` blocks typing and selection, but the input stays focusable, the list still opens and the value still submits

Preview

React Vue Angular Svelte Solid Preact Lit

Usage

This component needs JavaScript. Use the Web Component or a framework wrapper.

<arc-combobox label="Select Fruit" placeholder="Type to search...">
  <arc-option value="apple">Apple</arc-option>
  <arc-option value="banana">Banana</arc-option>
  <arc-option value="cherry">Cherry</arc-option>
</arc-combobox>

API

valuestring''
The currently selected option value. Reflected as an attribute so it can be read from the DOM. Updated automatically when the user selects an option.
placeholderstring''
Placeholder text shown in the input when no value is entered.
labelstring''
Visible label rendered above the input. Also used as the accessible label for the combobox.
namestring''
disabledbooleanfalse
Disables the input and prevents interaction. The host element receives reduced opacity and pointer-events: none.
readonlybooleanfalse
Prevents typing and selecting an option while the input stays focusable; the list can still be opened for viewing and the value still submits.
size'sm' | 'md' | 'lg''md'
Control size. md is the default; sm and lg scale the field padding.
formAssociatedbooleantrue
propertiesobject{ // flag(), unlike `disabled`. The exclusion in props.js is specifically // about form-associated *platform* semantics: a `disabled` content // attribute that is merely present makes the element actually disabled // per the HTML spec, and formDisabledCallback assigns the property back, // so no converter can win. Neither of these is platform-mapped: // `required` is enforced by _computeValidity() below and `readonly` by // each component's own interaction handlers, so the stock converter buys // nothing here and costs the usual bug: `required="false"` read as true, // blocking submission of a form the author meant to leave optional. // Finding #48's shape, across all 26 form controls at once. required: flag(false), readonly: flag(false), }
Lit merges static properties up the prototype chain, so every consumer gets these without declaring them. required participates in constraint validation below; readonly reflects for styling and is enforced by each component's interaction handlers (the mixin can't know which gestures mutate state).
autoValidatesbooleantrue
Components that run their own constraint-validation logic (pattern checks, range checks) opt out of the automatic required sync by overriding this to false, and own the whole validity flag set instead.
form
validity
validationMessage
requiredbooleanfalse

Methods

checkValidity()boolean
Whether the control currently satisfies its constraints, per the native constraint-validation API. Fires invalid on the element when it does not, and reports nothing to the user.
reportValidity()boolean
As checkValidity(), but also shows the browser's validation message against the control when it fails.

Events

arc-input
Fired on every keystroke in the filter input. event.detail.value contains the current query text.
arc-change
Fired when an option is selected. event.detail.value contains the selected option value.

See also