Skip to main content

KeyboardShortcut

    Use the KeyboardShortcut to display one or more keys that represent a keyboard shortcut for a specific action.

    Import​

    import { KeyboardShortcut } from '@dynatrace/strato-components/content';

    Demo​

    Specify the key sequence using the aria-keyshortcuts format: one or more modifier keys joined by a plus sign, followed by a non-modifier key (for example, Control+S). When multiple alternative combinations are defined, only the first is displayed.

    Adapt combination to the platform​

    The mod modifier resolves to Meta on macOS and to Control on every other platform. For a combination that differs by more than the modifier, pass an object instead of a string: macos applies on macOS when it is set, and default applies everywhere else.

    Disable component​

    The KeyboardShortcut component can also be displayed in a disabled state. By setting the disabled attribute, the styling is adjusted accordingly and the aria-disabled attribute is applied to indicate that the shortcut is currently disabled.

    Change variant​

    Use the variant prop to define if the component should be rendered using the default or minimal styling.

    Still have questions?
    Find answers in the Dynatrace Community