TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Shortcut Hint Navigation

A keyboard shortcut hint slides into view at the end of an admin-menu item.

Live Demo

Hover over the element or use Tab to focus.

Source Code

Copy the HTML, CSS or JavaScript you need for your project.

HTML
<nav class="tbx-1202" aria-label="Administration menu"><a href="#dashboard" class="tbx-1202__item"><span class="tbx-1202__symbol" aria-hidden="true">▦</span><b>Dashboard</b><small>G</small></a><a href="#library" class="tbx-1202__item"><span class="tbx-1202__symbol" aria-hidden="true">◈</span><b>Asset library</b><small>L</small></a><a href="#settings" class="tbx-1202__item"><span class="tbx-1202__symbol" aria-hidden="true">⚙</span><b>Settings</b><small>S</small></a></nav>
CSS
.tbx-1202{display:grid;width:245px;max-width:100%;background:#142c3b;border-radius:10px;padding:12px;box-sizing:border-box;gap:3px;font-family:system-ui}.tbx-1202__item{position:relative;display:flex;align-items:center;gap:12px;padding:9px 12px;color:#e4f0f3;text-decoration:none;border-radius:5px;overflow:hidden;transition:background .25s}.tbx-1202__symbol{font-size:16px;color:#9bced0;width:21px;text-align:center}.tbx-1202__item b{font-size:12px;font-weight:650}.tbx-1202__item small{margin-left:auto;font-size:10px;width:18px;height:18px;display:grid;place-items:center;border:1px solid #9db2bd77;border-radius:4px;opacity:0;transform:translateX(12px);transition:transform .32s,opacity .32s}.tbx-1202__item:is(:hover,:focus-visible){background:#335769}.tbx-1202__item:is(:hover,:focus-visible) small{opacity:1;transform:translateX(0)}.tbx-1202__item:focus-visible{outline:2px solid #ffc981;outline-offset:-2px}
@media (prefers-reduced-motion: reduce) {.tbx-1202,.tbx-1202 *,.tbx-1202::before,.tbx-1202::after,.tbx-1202 *::before,.tbx-1202 *::after{transition-duration:.01ms!important;animation-duration:.01ms!important;scroll-behavior:auto!important}}

How to Use

Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.

Use Case

Useful for data dashboards and navigation menus.

Technical Notes

Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.

Mobile:Ensure the interactive content remains accessible without hover on touch devices.

Browser:Uses modern CSS. Check behavior in the browsers you support.

Reduced Motion:Check that prefers-reduced-motion is respected.