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#
Name | Type | Default | Description |
---|---|---|---|
variant | light dark ghost | light | The visual variant to apply to shortcut. |
disabled | boolean | false | When true , prevents the user from interacting with the shortcut. |
size | md sm xs | md | The size of the shortcut. |
shortcutKey | string | none | Sets 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) => void | none | Event handler called when user pressed the shortcutKey. |