On this page
API Reference

Shortcut#

Github

Keyboard shortcuts are a way to quickly perform an action by pressing one or more keys on the keyboard. Shortcuts can significantly improve work efficiency and reduce the frequency of using the mouse.

import { Shortcut } from "wis/shortcut"

API Reference#

NameTypeDefaultDescription
variantlight dark ghostlightThe visual variant to apply to shortcut.
disabledbooleanfalseWhen true, prevents the user from interacting with the shortcut.
sizemd sm xsmdThe size of the shortcut.
shortcutKeystringnoneSets a global shortcut key, such as Control+I. When the user presses the combination key, the onKeyPressed event will be triggered. View Keyboard
onKeyPressed(event: KeyboardEvent, shortcut: ShortcutMeta) => voidnoneEvent handler called when user pressed the shortcutKey.