chore(Kbd): new component

This commit is contained in:
Benjamin Canac
2023-05-09 14:26:10 +02:00
parent b21c55f5c4
commit 4586eed90c
14 changed files with 167 additions and 32 deletions

View File

@@ -22,10 +22,12 @@ const items = [
}
}], [{
label: 'Edit',
icon: 'i-heroicons-pencil-square-20-solid'
icon: 'i-heroicons-pencil-square-20-solid',
shortcuts: ['E']
}, {
label: 'Duplicate',
icon: 'i-heroicons-document-duplicate-20-solid'
icon: 'i-heroicons-document-duplicate-20-solid',
shortcuts: ['D']
}], [{
label: 'Archive',
icon: 'i-heroicons-archive-box-20-solid'
@@ -34,7 +36,8 @@ const items = [
icon: 'i-heroicons-arrow-right-circle-20-solid'
}], [{
label: 'Delete',
icon: 'i-heroicons-trash-20-solid'
icon: 'i-heroicons-trash-20-solid',
shortcuts: ['⌘', 'D']
}]
]
</script>

View File

@@ -0,0 +1,48 @@
---
github: true
title: 'Keyboard Key'
navigation:
title: 'Kbd'
---
## Usage
::component-example
#default
:kbd-example
#code
```vue
<script setup>
const { metaSymbol } = useShortcuts()
</script>
<template>
<div class="flex items-center gap-0.5">
<UKbd>{{ metaSymbol }}</UKbd>
<UKbd>U</UKbd>
</div>
</template>
```
::
### Size
Use the `size` prop to change the size of the Kbd.
::component-card
---
props:
size: 'sm'
---
U
::
## Props
:component-props
## Preset
:component-preset