Markdown Reference · Extended syntax

Markdown Keyboard Keys: KBD Tag Syntax Guide

Format keyboard shortcuts and interactive keycaps cleanly using HTML kbd tags in Markdown.

Extended MarkdownCategory: Extended syntax
Primary SyntaxExtended Markdown
<kbd>⌘</kbd> + <kbd>O</kbd> (Open palette)
<kbd>Ctrl</kbd> + <kbd>C</kbd> (Copy)

Documenting keyboard shortcuts, terminal key combinations, and user interaction sequences is a core requirement of technical writing, software user manuals, and personal workflow notes.

While standard CommonMark does not define dedicated punctuation for keyboard keys, Markdown allows embedding standard HTML elements. The semantic <kbd> tag is universally recognized across all Markdown engines as the standard method for formatting keyboard buttons.

In Oyma and modern web documentation, <kbd> tags compile into tactile keycap buttons styled to resemble physical computer keys.

Basic <kbd> syntax

To format a keyboard button, wrap the key name or symbol inside <kbd> tags:

Press <kbd>Enter</kbd> to confirm the selection.
Press <kbd>Esc</kbd> to dismiss the modal dialog.

In the rendered view, the text is framed in an elevated box featuring a subtle border, background tint, and drop shadow, clearly distinguishing it from surrounding prose.

Formatting macOS shortcut combinations

On macOS, keyboard shortcuts traditionally combine Apple modifier symbols with letter keys. You can write these symbols directly inside <kbd> tags:

| Action | macOS Shortcut | Windows / Linux Equivalent |
| :--- | :--- | :--- |
| Open Command Palette | <kbd>⌘</kbd> + <kbd>O</kbd> | <kbd>Ctrl</kbd> + <kbd>O</kbd> |
| Jump to Daily Note | <kbd>⌘</kbd> + <kbd>D</kbd> | <kbd>Ctrl</kbd> + <kbd>D</kbd> |
| Toggle Task Status | <kbd>⌘</kbd> + <kbd>Enter</kbd> | <kbd>Ctrl</kbd> + <kbd>Enter</kbd> |
| Record Meeting | <kbd>⌥</kbd> + <kbd>⌘</kbd> + <kbd>R</kbd> | <kbd>Alt</kbd> + <kbd>Win</kbd> + <kbd>R</kbd> |
| Toggle Bold Text | <kbd>⌘</kbd> + <kbd>B</kbd> | <kbd>Ctrl</kbd> + <kbd>B</kbd> |
| Full-Text Search | <kbd>⌘</kbd> + <kbd>F</kbd> | <kbd>Ctrl</kbd> + <kbd>F</kbd> |

Essential macOS keyboard Unicode symbols

You can copy and paste these standard Unicode characters directly into your Markdown files:

  • ⌘ : Command (U+2318)
  • ⌥ : Option / Alt (U+2325)
  • ⇧ : Shift (U+21E7)
  • ⌃ : Control (U+2303)
  • ⎋ : Escape (U+238B)
  • ⌫ : Delete / Backspace (U+232B)
  • ↩ : Return / Enter (U+21A9)
  • ⇥ : Tab (U+21E5)
  • ␣ : Space (U+2423)

Multi-key combinations: separate tags vs single tag

There are two common formatting conventions for multi-key shortcuts:

Press <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>P</kbd> to open preferences.

This clearly communicates that three distinct keys must be pressed simultaneously.

Convention 2: Nested keycaps

Press <kbd><kbd>⌘</kbd> + <kbd>K</kbd></kbd> to open quick search.

Some documentation style guides nest individual keys inside a parent container.

Best practices for shortcut documentation

  1. Be platform-explicit: Always clarify whether a shortcut applies to macOS (⌘) or Windows/Linux (Ctrl).
  2. Capitalize letter keys: Write <kbd>K</kbd> rather than <kbd>k</kbd> for consistency.
  3. Use <kbd> instead of inline code: While writing `⌘O` is common in quick notes, using <kbd>⌘</kbd> + <kbd>O</kbd> conveys explicit semantic meaning to screen readers and browsers.

Keycaps in Oyma on macOS

In Oyma:

  • <kbd> tags render with native Apple Silicon craftsmanship: crisp typography, subtle elevation, and responsive dark mode support.
  • Live preview renders the keycaps cleanly without displaying raw HTML brackets.
  • Files remain 100% standard plain text on your Mac disk.

Frequently asked questions

What is the syntax for keyboard keys in Markdown?
Keyboard shortcuts are written using the standard HTML `` tag: `⌘ + K`. This wraps the text in an interactive keycap box styled like a physical keyboard button.
How do I write macOS modifier symbols (⌘, ⌥, ⇧, ⌃) in Markdown?
You can type macOS symbols directly into your Markdown files: `⌘` (Command, U+2318), `⌥` (Option, U+2325), `⇧` (Shift, U+21E7), `⌃` (Control, U+2303), and `⎋` (Escape, U+238B).
Can I nest multiple keys inside a single <kbd> tag?
Yes. You can write `⌘ + O` or nest them: `⌘ + O`. Placing each key in its own `` tag is the standard convention.
How does Oyma render keyboard tags in notes?
Oyma formats `` tags as refined, elevated 3D keycaps matching Apple's native macOS interface design with subtle borders, shadows, and rounded corners.

Experience Keyboard Key Tags (<kbd>) with zero lock-in.

Write Extended Markdown notes directly on your Mac with native live preview and sovereign local storage.

One email when your invite is ready. No newsletter.