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

Command Bar

Search input that stays visible in a top bar or toolbar. The border turns accent-colored with a glow ring on focus.

ComponentsCommand Bar
navigationinteractive
<arc-command-bar>

Overview

CommandBar is a search field for a TopBar or toolbar. It renders an icon, a text input and a `hint` slot. It fires `arc-input` on every keystroke and `arc-submit` on Enter, both with `{ value }`. It doesn't render results: show them in a dropdown or popover, or send the submitted value to a results page. Use it where people search all the time, as in an admin dashboard or a docs site. When search is occasional, use CommandPalette, a modal overlay you open on demand.

Guidelines

Do

  • Write a placeholder that names the scope, such as "Search docs..."
  • If there's more than one on a page, give each a different `label`. Otherwise they're all announced as "Search"
  • Give it a max-width so it doesn't take over the toolbar

Don't

  • Don't use it as a general text input. It's styled and labeled for search

Features

  • `label` sets the input's `aria-label` and defaults to "Search". The placeholder is never used as the name
  • `icon` takes any Phosphor icon name and defaults to `magnifying-glass`
  • Enter is claimed, so inside a `<form>` it fires `arc-submit` without also submitting the form
  • Set `value` from outside to control the input

Preview

Usage

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

<script type="module" src="@arclux/arc-ui"></script>

<arc-command-bar placeholder="Search..." id="search"></arc-command-bar>

<script>
  const bar = document.querySelector('#search');
  bar.addEventListener('arc-input', (e) => {
    console.log('typing:', e.detail.value);
  });
  bar.addEventListener('arc-submit', (e) => {
    console.log('submitted:', e.detail.value);
  });
</script>

API

placeholderstring'Search…'
Placeholder text displayed when the input is empty. Use it to communicate the scope of the search.
valuestring''
The current value of the input. Set externally to control the input state programmatically.
iconstring'magnifying-glass'
Icon name displayed before the input. Accepts any Phosphor icon name.
labelstring''
Accessible name for the input, applied as aria-label. Defaults to "Search". A placeholder is not a name: it is announced inconsistently and disappears the moment the user types.

Events

arc-inputdetail:{ value: string }
Fired on every keystroke with detail: { value }.
arc-submitdetail:{ value: string }
Fired when the user presses Enter with detail: { value }.

See also