Show keystrokes on a website with the <​show-keystrokes> custom element Developer Chris Coyier built ``, a web-native custom element that displays keyboard shortcuts and navigational keys on screen during demos, after a corporate security policy blocked his native macOS keystroke-visualization app and it failed to render when screen sharing a specific window or tab. The component loads from npm or a CDN via a single script tag, listens for keyboard events by default, and can be set to `keystrokes="all"` to show every key press. It uses the Popover API's `popover="manual"` Top Layer promotion and CSS Anchor Positioning with `position-try-fallbacks: flip-inline, flip-block, flip-inline flip-block` to stay visible and reposition itself in viewport, pointer, or normal document flow modes. ~ When recording screen casts or doing live demos, I typically rely on a native macOS app to visualize my keystrokes on screen. Recently, however, that app got blocked on my work machine by a corporate security policy. Additionally, the keystrokes visualized through that app don’t show up when screen sharing a specific window or tab. Because I needed to demo a website that relies heavily on keyboard navigation — and thus really needed those keystrokes to be visible to the audience — I found myself in a bit of a pickle. So with the help of Gemini, I decided to build a web-native solution to fill that gap: