<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz" -->

---
title: Show keystrokes on a website with the <show-keystrokes>...
description: A new open-source web component, <show-keystrokes>, visualizes keyboard shortcuts and navigation keys on screen for screencasts and live demos, offering a...
canonical: https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Show keystrokes on a website with the <show-keystrokes> custom element | daily.dev
og:description: A new open-source web component, <show-keystrokes>, visualizes keyboard shortcuts and navigation keys on screen for screencasts and live demos, offering a...
og:url: https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz
og:image: https://api.daily.dev/og/posts/nWR24Wrlz.png
og:image:alt: Show keystrokes on a website with the <show-keystrokes> custom element
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Show keystrokes on a website with the <show-keystrokes> custom element

**[Bram.us](https://daily.dev/sources/bram)** · 5 min read · 2 upvotes · 0 comments

## Summary

A new open-source web component, <show-keystrokes>, visualizes keyboard shortcuts and navigation keys on screen for screencasts and live demos, offering a browser-native alternative to native macOS keystroke-visualizer apps that get blocked by corporate security policies or don't show up in window/tab screen sharing. It's embedded via a single script tag, supports positioning modes (viewport corner, following the cursor, or inline), and adapts automatically to macOS versus Windows/Linux modifier key labels with light/dark theming. Under the hood it relies on the Popover API for top-layer rendering and CSS Anchor Positioning for cursor-following behavior with automatic flip fallbacks. The project also ships a bookmarklet and a Chrome Extension (pending Chrome Web Store review) so it can be injected onto any site, including ones with strict CSP.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.bram.us/2026/09/23/show-keystrokes>

## Questions this post answers

### How can I show keyboard shortcuts on screen during a screen recording or live demo without a native app?

Use the open-source <show-keystrokes> custom element, embedded via a single module script tag on any page. It listens for keyboard events and displays shortcuts like ⌘+A or navigational keys like Tab and arrows by default, while ignoring regular typing unless the keystrokes attribute is set to 'all'. A bookmarklet and Chrome Extension let you inject it onto any site you don't control the source of.

_daily.dev surfaces web component projects like this for developers polishing their demo and presentation workflow._

### How does the show-keystrokes web component keep its keystroke overlay always on top of the page without z-index hacks?

It uses the Popover API, promoting its internal container to the browser's top layer via popover="manual". This guarantees the overlay is never clipped or hidden regardless of the host page's stacking contexts, avoiding manual z-index management or JavaScript bounding-box calculations entirely.

_Developers tracking Popover API use cases can follow patterns like this one on daily.dev._

### How can I make a positioned element follow the mouse cursor using CSS Anchor Positioning?

An invisible anchor element tracks cursor coordinates via custom properties, and the target element anchors itself next to it using the CSS position-area property. Default position-try-fallbacks of flip-inline, flip-block, and flip-inline flip-block make the browser automatically flip the element to the cursor's other side near viewport edges.

_daily.dev helps developers experimenting with CSS anchor positioning find implementation patterns like this._

## Similar posts on daily.dev

- [A minimal keyboard key effect with CSS](https://daily.dev/posts/a-minimal-keyboard-key-effect-with-css-lrsy90dcz) · Lobsters · 1 upvotes · 0 comments
- [Getting Started With The Popover API — Smashing Magazine](https://daily.dev/posts/getting-started-with-the-popover-api-smashing-magazine-vjbltzl0j) · Smashing Magazine · 47 upvotes · 1 comments
- [I ditched my browser bookmarks for a two-keystroke launcher, and getting to anything takes seconds now](https://daily.dev/posts/i-ditched-my-browser-bookmarks-for-a-two-keystroke-launcher-and-getting-to-anything-takes-seconds-n-vf3eshv6e) · XDA Developers · 3 upvotes · 0 comments
- [430: The Wild World of Keyboard Shortcuts in Web Apps](https://daily.dev/posts/430-the-wild-world-of-keyboard-shortcuts-in-web-apps-nkahwojxm) · CodePen · 3 upvotes · 0 comments
- [Keyboard Shortcuts That Display The Correct Modifier Key per OS – Master.dev Blog](https://daily.dev/posts/keyboard-shortcuts-that-display-the-correct-modifier-key-per-os-master-dev-blog-dzveifmsr) · Frontend Masters · 2 upvotes · 1 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#devtools](https://daily.dev/tags/devtools), [#web-components](https://daily.dev/tags/web-components)

[View this post on daily.dev](https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Show keystrokes on a website with the \u003cshow-keystrokes\u003e custom element","url":"https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz"},"datePublished":"2026-09-23T08:36:17.060Z","dateModified":"2026-09-23T08:36:40.183Z","description":"A new open-source web component, \u003cshow-keystrokes\u003e, visualizes keyboard shortcuts and navigation keys on screen for screencasts and live demos, offering a...","image":"https://media.daily.dev/image/fetch/s--Gysb17Tu--/f_auto,pg_1,q_auto/https://www.bram.us/wordpress/wp-content/uploads/2026/09/show-keystrokes.gif?_a=BAMAMiZY0","thumbnailUrl":"https://media.daily.dev/image/fetch/s--Gysb17Tu--/f_auto,pg_1,q_auto/https://www.bram.us/wordpress/wp-content/uploads/2026/09/show-keystrokes.gif?_a=BAMAMiZY0","isAccessibleForFree":true,"articleSection":"Bram.us","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Bram.us","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/3db2116954be44df873ec24cf0e03d14","url":"https://daily.dev/sources/bram"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,devtools,web-components","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Bram.us","item":"https://daily.dev/sources/bram"},{"@type":"ListItem","position":3,"name":"Show keystrokes on a website with the \u003cshow-keystrokes\u003e custom element"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/show-keystrokes-on-a-website-with-the-show-keystrokes-custom-element-nwr24wrlz#faq","mainEntity":[{"@type":"Question","name":"How can I show keyboard shortcuts on screen during a screen recording or live demo without a native app?","acceptedAnswer":{"@type":"Answer","text":"Use the open-source \u003cshow-keystrokes\u003e custom element, embedded via a single module script tag on any page. It listens for keyboard events and displays shortcuts like ⌘+A or navigational keys like Tab and arrows by default, while ignoring regular typing unless the keystrokes attribute is set to 'all'. A bookmarklet and Chrome Extension let you inject it onto any site you don't control the source of. daily.dev surfaces web component projects like this for developers polishing their demo and presentation workflow."}},{"@type":"Question","name":"How does the show-keystrokes web component keep its keystroke overlay always on top of the page without z-index hacks?","acceptedAnswer":{"@type":"Answer","text":"It uses the Popover API, promoting its internal container to the browser's top layer via popover=\"manual\". This guarantees the overlay is never clipped or hidden regardless of the host page's stacking contexts, avoiding manual z-index management or JavaScript bounding-box calculations entirely. Developers tracking Popover API use cases can follow patterns like this one on daily.dev."}},{"@type":"Question","name":"How can I make a positioned element follow the mouse cursor using CSS Anchor Positioning?","acceptedAnswer":{"@type":"Answer","text":"An invisible anchor element tracks cursor coordinates via custom properties, and the target element anchors itself next to it using the CSS position-area property. Default position-try-fallbacks of flip-inline, flip-block, and flip-inline flip-block make the browser automatically flip the element to the cursor's other side near viewport edges. daily.dev helps developers experimenting with CSS anchor positioning find implementation patterns like this."}}]}
```

