Tesserae

KeyboardShortcut

Description

Render keyboard shortcuts as styled key chips

KeyboardShortcut renders one or more key names as styled chips that look like physical keyboard keys. It automatically adapts modifier key labels to the current OS (⌘ on macOS, Ctrl on Windows/Linux) and handles special keys like Enter (↵), Escape, and arrow keys.

API reference

class

KeyboardShortcut

public sealed class KeyboardShortcut : ComponentBase<KeyboardShortcut, HTMLElement>

Renders a keyboard shortcut as styled <kbd> chips (e.g. Ctrl+K).

Constructors

Constructor
KeyboardShortcut
public KeyboardShortcut(params string[] keys)

Initializes a new instance of this class.

Methods

Method
KeyboardShortcut.Render
public override HTMLElement Render()

Renders the component's root HTML element.

Samples

Common Shortcuts

Special Keys

Inline Usage

See also

© 2026 Tesserae. All rights reserved.