Logoshadcn-docs-template
DocsDemo
Sections
  • Get Started
Getting Started
  • Introduction
  • Installation
Customization
  • Customizing the Template
  • MDC Components
  • Composables
  • Writing Documentation
Components
  • DocTabs
  • Callout
  • ComponentPreview
  • CommandMenu
  • CopyButton
  • DocsSidebar
  • DocsTableOfContents
  • PageHeader
  • SiteHeader
  • CopyCodeButton
  • DocsCopyPage
  • CodeBlockCommand
  • CommandMenuItem
  • CommandMenuKbd
  • GitHubLink
  • LucideIcon
  • MainNav
  • MobileNav
  • ModeSwitcher
  • PageHeaderDescription
  • PageHeaderHeading
  • SiteBody
  • SiteConfig
  • SiteFooter
  • OgImage (Custom)

CommandMenuKbd

PreviousNext

A keyboard shortcut badge component for displaying keyboard shortcuts in the command menu footer.

The CommandMenuKbd component renders keyboard shortcut badges (like ⌘ K) in the command menu footer.

Usage

<script setup lang="ts">
import { CommandMenuKbd } from '@/components/CommandMenuKbd'
</script>

<template>
  <CommandMenuKbd>⌘</CommandMenuKbd>
  <CommandMenuKbd>K</CommandMenuKbd>
</template>

Features

  • Styled keyboard key appearance
  • Supports icons (SVG) via slot
  • Responsive sizing
  • Accessible styling

API Reference

CommandMenuKbd

No props. Uses slot content for the key text or icon.

Styling

The component uses:

  • Small font size (text-[0.7rem])
  • Border and background styling
  • Rounded corners
  • Proper spacing
  • Icon support with size constraints

Examples

Text Keys

<template>
  <CommandMenuKbd>Ctrl</CommandMenuKbd>
  <CommandMenuKbd>C</CommandMenuKbd>
</template>

With Icons

<template>
  <CommandMenuKbd>
    <CornerDownLeft />
  </CommandMenuKbd>
</template>
CommandMenuItemGitHubLink

On This Page

UsageFeaturesAPI ReferenceCommandMenuKbdStylingExamplesText KeysWith Icons
© shadcn-vue.com