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

Hotkey

An invisible element that fires an event when someone presses a keyboard shortcut, like Ctrl+K or the chord g i.

ComponentsHotkey
inputinteractive
<arc-hotkey>

Overview

Hotkey listens for a keyboard shortcut and fires `arc-hotkey-trigger` when someone presses it. It renders nothing (`display: none` is enforced), so you can put it anywhere in your markup. The `keys` prop takes modifier combos like `"ctrl+k"`, `"meta+shift+p"` and `"alt+n"`, or a Vim-style chord of space-separated keys pressed in order: `"g i"` means press G, release, then press I within 1 second. Modifier names are normalized: `cmd`/`command` → `meta`, `option` → `alt`, `control` → `ctrl`. By default, Hotkey ignores keys typed into a text input, textarea, select or contentEditable element. Inputs you don't type into, like checkboxes and sliders, don't block it. Setting `global` listens on `window` instead of `document` and drops that filter, so the shortcut also fires while someone is typing.

Guidelines

Do

  • Set `global` for shortcuts that must work inside text inputs, such as Ctrl+S
  • Show the shortcut somewhere in the UI, in a tooltip or a menu item
  • Set `disabled` while a modal or dialog is open

Don't

  • Don't bind shortcuts the browser reserves, like Ctrl+T, Ctrl+W and Ctrl+N. They won't fire
  • Don't make chords longer than two or three keys. People won't remember them
  • Don't make a hotkey the only way to reach a feature. Give it a button or menu item too

Features

  • `disabled` suspends the shortcut without removing the element
  • The event's `detail.keys` holds the pattern that matched

Preview

Press Ctrl+K to trigger the shortcut

Usage

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

<!-- Search shortcut -->
<arc-hotkey keys="ctrl+k" id="search-hotkey"></arc-hotkey>

<!-- Vim-style chord: press g, then i -->
<arc-hotkey keys="g i" id="go-inbox"></arc-hotkey>

<!-- Global shortcut (works in inputs) -->
<arc-hotkey keys="ctrl+s" global id="save-hotkey"></arc-hotkey>

<script type="module">
  document.getElementById('search-hotkey')
    .addEventListener('arc-hotkey-trigger', () => openSearch());

  document.getElementById('save-hotkey')
    .addEventListener('arc-hotkey-trigger', () => saveDocument());
</script>

API

keysstring''
Key pattern to match. Modifier combos use "+" (e.g., "ctrl+k"). Chords use spaces (e.g., "g i").
disabledbooleanfalse
Temporarily suspends the shortcut listener.
globalbooleanfalse
When true, attaches to window instead of document and skips input/textarea filtering.

Events

arc-hotkey-triggerdetail:{ keys: string }
Fired when the full key pattern is matched. event.detail.keys contains the matched pattern string.

See also