Keyboard shortcut outlines a key combination with a border to represent a keyboard shortcut. + will be rendered as an icon rather than text. Supported symbol tags can be used in the shortcut prop, see the Props, Slots & Events section.
<dt-keyboard-shortcut shortcut="{cmd}+Ctrl+X"/>Control+P is print.In place of the inverted prop, use the v-dt-mode directive on the component element.
<div class="d-bgc-contrast d-p-200"> <dt-keyboard-shortcut v-dt-mode:invert shortcut="{cmd}+Ctrl+X" /> </div>
<dt-keyboard-shortcut
class="d-fs-200"
shortcut="{cmd}+Y"
/><dt-keyboard-shortcut
shortcut="{cmd}+{opt}+{win}+{arrow-right}+{arrow-left}+{arrow-up}+{arrow-down}+A"
/><dt-text kind="body" :size="300"> Press <dt-keyboard-shortcut screen-reader-text="Control plus F5" shortcut="Ctrl + F5" /> to hard refresh the page. </dt-text>
Keyboard shortcuts are visible to sighted users and made available to assistive technology. This component automatically generates accessible text in a visually-hidden element that will be announced by screen readers.
The auto-generated accessible text converts:
{cmd}) to full names (e.g., "Command")+) to the word "plus"For example, {cmd}+Ctrl+X will be announced as "Command plus Control plus X".
You can override the auto-generated accessible text by providing the screenReaderText prop with custom text.
If an element (e.g. a button) can be triggered by a keyboard shortcut, the aria-keyshortcuts attribute should be used to announce the keyboard shortcut to screen readers.
Example:
// This button can be activated by pressing control+shift+v, let's indicate that
// to the screenreader by using aria-keyshortcuts.
<button aria-keyshortcuts="control+shift+v">Press Me</button>
Abbreviations / symbols should be spelled out in full for voiceover / screen readers, e.g. "Control" instead of "Ctrl".
import { DtKeyboardShortcut } from '@dialpad/dialtone-vue';
Name
|
Default
|
Type
|
|---|---|---|
shortcut
required
| string Include any of these tokens in your string to render the corresponding symbol:
{cmd} {opt} {win} {arrow-right} {arrow-left} {arrow-up} {arrow-down} | |
screenReaderText | null | string Optional text to override the auto-generated accessible text for assistive technology.
If not provided, accessible text will be automatically generated from the shortcut. |
inverted Deprecated | false |
"true"
|
"false"
Use v-dt-mode instead. If true, applies inverted styles. |
Keyboard shortcut documentation last updated Friday, September 4, 2026
fix/popover-modal-zindex-scope