kbd
Keyboard shortcuts reference list
Keyboard shortcuts reference list
Загрузка превью…
src/kbd/c-kbd-6.vue
<script setup lang="ts">
import { Kbd, KbdGroup } from "@/components/ui/kbd"
import { Separator } from "@/components/ui/separator"
const shortcuts = [
{ label: "Search", keys: ["⌘", "K"] },
{ label: "New File", keys: ["⌘", "N"] },
{ label: "Save", keys: ["⌘", "S"] },
{ label: "Undo", keys: ["⌘", "Z"] },
{ label: "Redo", keys: ["⌘", "⇧", "Z"] },
]
</script>
<template>
<div class="mx-auto flex w-full max-w-xs flex-col">
<p class="mb-3 text-sm font-medium">Keyboard Shortcuts</p>
<Separator />
<div class="flex flex-col">
<div
v-for="shortcut in shortcuts"
:key="shortcut.label"
class="flex items-center justify-between border-b py-2.5 last:border-b-0"
>
<span class="text-muted-foreground text-sm">
{{ shortcut.label }}
</span>
<KbdGroup>
<Kbd v-for="key in shortcut.keys" :key="key">{{ key }}</Kbd>
</KbdGroup>
</div>
</div>
</div>
</template>