Shortcut help
Show a key combination next to the command it invokes.
Components / Utilities
A native keyboard-input hint for shortcuts and commands.
Show a key combination next to the command it invokes.
Explain which key dismisses an overlay or confirms a choice.
<div class="flex flex-wrap gap-4">
<span>Search <Kbd>Ctrl</Kbd> <Kbd>K</Kbd></span>
<span>Save <Kbd>Ctrl</Kbd> <Kbd>S</Kbd></span>
<span>Close <Kbd>Esc</Kbd></span>
<span>Command <Kbd aria-label="Command key"><template #icon><CommandIcon aria-hidden="true" /></template></Kbd></span>
</div>Show each key as a separate semantic keycap.
<script setup lang="ts">
import Kbd from './components/ui/kbd/Kbd.vue'
</script>
<template>
<p>Search: <Kbd>Ctrl</Kbd> + <Kbd>K</Kbd></p>
</template>Use the small size in a dense command menu.
<script setup lang="ts">
import Kbd from './components/ui/kbd/Kbd.vue'
</script>
<template>
<span>Close menu <Kbd size="sm">Esc</Kbd></span>
</template>The most useful props, models, slots, events, and methods for this component.
| Name | Type | Default or requirement |
|---|---|---|
size | sm | md | md |
Use the #icon slot for a decorative icon beside a key label. Give icon-only hints an accessible name. Kbd displays shortcuts; bind the actual keyboard behavior in your application.