Skip to content
UTILITIES · FREE

Hotkey

Add keyboard shortcuts that power users will love.

Add keyboard shortcuts power users will love, such as Alt+K or Ctrl+Shift+L.

Why it helps

  • Shortcuts as components
  • Platform-aware modifier
  • Invisible

Where it fits

  • Search
  • Commands
  • Editors

Example

<Hotkey Keys="alt+k" OnPressed="@(() => _count++)" />
<Hotkey Keys="mod+shift+l" OnPressed="@(() => _toggled = !_toggled)" />

<Stack Align="center">
    <span>Press <kbd>Alt</kbd>+<kbd>K</kbd> (count: @_count) or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>L</kbd> (@(_toggled ? "on" : "off")).</span>
</Stack>

@code {
    private int _count;
    private bool _toggled;
}

A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.

Included in RayCraft Free. Working examples are in the GitHub repository (MIT); it holds example and demo code, not the library code.

All controls ยท Documentation