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

Keyboard Map

Draws a keyboard with the keys of one or more shortcuts lit up, for shortcut docs and cheat sheets.

ComponentsKeyboard Map
typographystatic
<arc-keyboard-map>

Overview

Keyboard Map draws a keyboard as a grid of keycaps and highlights the keys named in its `highlight` prop. For a key name in a sentence, use Kbd. Highlighted keys get an accent tint, a glow and accent legend text. Chords are written the way Hotkey writes them: keys join with "+", `cmd`/`command` normalize to meta and `option` to alt. Keyboard Map also takes `mod`, which Hotkey doesn't. It resolves to Cmd on Mac and Ctrl on Windows, so one chord string documents both. `platform` sets the modifier legends and how `mod` resolves: "auto" detects the visitor's platform in the browser (and renders the Mac board on the server), and "mac" or "win" pins it. The board is a stylized diagram with two layouts. `compact` (the default) is a 60%-style block with no nav cluster or numpad, and `ansi` adds the F-row and nav cluster. There's no ISO or JIS layout. Nothing on the board is clickable or focusable. To make a shortcut work, use Hotkey. The board is one `role="img"` whose label is computed from the chords ("Keyboard diagram highlighting Cmd+Shift+P"), and the key legends are hidden from assistive technology.

Guidelines

Do

  • Use it for cheat sheets and settings pages. For a shortcut mentioned in a sentence, use Kbd
  • Put related chords on one board, such as undo and redo, and give it a caption naming the group
  • Use the compact layout unless a chord uses the F-row or nav cluster

Don't

  • Don't make the board the only place a shortcut is written down. The computed label names the chords, but the surrounding text should too

Features

  • Modifier legends: ⌘ ⌥ ⇧ ⌃ on Mac, Ctrl/Alt/Shift/Win on Windows
  • `highlight` takes an array property or a comma- or space-separated attribute string. Unknown key names are ignored
  • Optional `caption` below the board in muted text
  • Scales to its container. `--keyboard-map-key` and `--keyboard-map-gap` set the geometry, and the legends drop out below about 340px
  • Unknown `layout` values fall back to compact

Preview

Usage

<!-- Chords as an attribute string; mod = Cmd on Mac, Ctrl on Windows -->
<arc-keyboard-map highlight="mod+z, mod+shift+z" caption="Undo and redo"></arc-keyboard-map>

<!-- Full board with F-row and nav cluster, pinned to Windows legends -->
<arc-keyboard-map layout="ansi" platform="win" highlight="alt+f4"></arc-keyboard-map>

<!-- Chords as an array property -->
<arc-keyboard-map id="palette-map"></arc-keyboard-map>
<script type="module">
  document.getElementById('palette-map').highlight = ['mod+shift+p', 'escape'];
</script>

API

layout'compact' | 'ansi''compact'
Board shape: "compact" (default, a 60%-style block) or "ansi" (adds the F-row and nav cluster). Unknown values fall back to compact.
highlightstring|string[]''
Key chords to light up: an array property (e.g. ["mod+z", "mod+shift+z"]) or a comma- or space-separated attribute string. Each chord joins keys with "+" ("mod+shift+p"); mod resolves to Cmd on mac and Ctrl on win, mirroring arc-hotkey's aliases (cmd/command → meta, option → alt, control → ctrl). Single keys are fine ("g", "escape"). Unknown key names are ignored.
labelsbooleantrue
Whether keys render their legends. Default true; disable from markup with either no-labels or labels="false".
platform'auto' | 'mac' | 'win''auto'
Which platform's modifier legends and mod resolution to use: "auto" (default, detected in the browser, mac on the server), "mac", or "win".
captionstring''
Optional caption rendered below the board in muted text.

See also