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

Highlight

Text highlighting with search query match markers.

ComponentsHighlight
typographystatic
<arc-highlight>

Overview

Highlight renders text with matching portions wrapped in `<mark>` tags, styled with the accent color. Pass the full text via the `text` attribute and the search query via `query`. The component splits the text at each match boundary and wraps matching segments in styled marks. The matching is case-insensitive by default, which suits most search UIs. Set `case-sensitive` for exact-case matching in technical contexts like code search or regex patterns. The query string is escaped for regex safety, so special characters like `.`, `(`, and `*` are matched literally rather than interpreted as regex operators. Highlight is designed to pair with Search, DataGrid, CommandPalette, and any component that displays filtered results. The mark styling uses `var(--accent-primary)` with low opacity for the background and a stronger underline, so matches stand out without overwhelming the surrounding text.

Guidelines

When to use

  • Use Highlight in search result lists to show why each result matched
  • Pair with Search or CommandPalette to highlight the active query in results
  • Use in DataGrid cells to highlight filtered column values
  • Update the query prop reactively as the user types for live highlighting

When not to use

  • Do not use Highlight for static emphasis. Use <strong> or Text variant="label" instead
  • Do not pass HTML content as the text prop. It expects plain text only
  • Do not use Highlight on very long text (>10KB) without debouncing the query updates
  • Do not set both text and slot content. The `text` prop takes precedence

Features

  • Automatic text splitting and mark wrapping at match boundaries
  • Case-insensitive matching by default, with case-sensitive option
  • Regex-safe query escaping: special characters match literally
  • Themed mark styling with accent color background and underline
  • Zero overhead for non-matching text: renders plain text without marks
  • CSS parts for mark and text segments for custom styling

Preview

Usage

<arc-highlight
  text="The quick brown fox jumps over the lazy dog"
  query="fox"
></arc-highlight>

<!-- Case-sensitive matching -->
<arc-highlight
  text="Hello World, hello world"
  query="Hello"
  case-sensitive
></arc-highlight>

API

textstring''
The full text to display and search within
querystring''
The search query to highlight within the text
caseSensitivebooleanfalse
Whether matching should be case-sensitive

See Also