UIPackage
Menu

Kbd

kbd ui
Edit on GitHub

Inline keyboard-key indicator — renders a single key or shortcut in monospace with a subtle bordered chip.

Also available for React ->

Installation

$ npx shadcn-vue@latest add https://uipkge.dev/r/vue/kbd.json
Named registry: npx shadcn-vue@latest add @uipkge/kbd Installs to: app/components/ui/kbd/

Examples

Props

Name Type / Values Default Required
class HTMLAttributes['class'] optional

Used by

Files installed (2)

  • app/components/ui/kbd/Kbd.vue 0.5 kB
    <script setup lang="ts">
    import type { HTMLAttributes } from 'vue'
    import { cn } from '@/lib/utils'
    
    const props = defineProps<{
      class?: HTMLAttributes['class']
    }>()
    </script>
    
    <template>
      <kbd
        data-uipkge
        data-slot="kbd"
        :class="
          cn(
            'bg-muted text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium select-none',
            props.class,
          )
        "
      >
        <slot />
      </kbd>
    </template>
  • app/components/ui/kbd/index.ts 0 kB
    export { default as Kbd } from './Kbd.vue'

Raw manifest: https://uipkge.dev/r/vue/kbd.json