Skip to content

Commit 95ab001

Browse files
committed
Add keyboard key components
1 parent 5e69e8e commit 95ab001

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

components/KeyboardKey.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script lang="ts" setup>
2+
defineProps<{ text?: string }>()
3+
</script>
4+
5+
<template>
6+
<small>
7+
<kbd class="monospace border border-layer-text-muted rounded px-1 border-b-2"><slot name="text">{{ text }}</slot></kbd>
8+
</small>
9+
</template>

components/KeyboardKeyCombination.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script lang="ts" setup>
2+
import KeyboardKey from './KeyboardKey.vue'
3+
4+
defineProps<{ keys?: Array<{ text: string }> }>()
5+
</script>
6+
7+
<template>
8+
<kbd class="inline-flex gap-0.5">
9+
<slot>
10+
<template v-if="keys">
11+
<KeyboardKey v-for="key in keys" :key="key.text" :text="key.text" />
12+
</template>
13+
</slot>
14+
</kbd>
15+
</template>

0 commit comments

Comments
 (0)