chore(Kbd): usage with value prop

This commit is contained in:
Benjamin Canac
2023-05-14 17:06:08 +02:00
parent 8caa78819a
commit ae02f23a8c
3 changed files with 28 additions and 3 deletions

View File

@@ -5,6 +5,6 @@ const { metaSymbol } = useShortcuts()
<template>
<div class="flex items-center gap-0.5">
<UKbd>{{ metaSymbol }}</UKbd>
<UKbd>U</UKbd>
<UKbd>K</UKbd>
</div>
</template>

View File

@@ -7,6 +7,27 @@ navigation:
## Usage
Use the default slot to set the text of the Kbd.
::component-card
---
code: K
---
K
::
You can also use the `value` prop:
::component-card
---
props:
value: K
---
::
As explained in the [Shortcuts](/getting-started/shortcuts) page, you can use the `metaSymbol` property of the `useShortcuts` composable to display the meta key according to the user's OS.
::component-example
#default
:kbd-example
@@ -20,7 +41,7 @@ const { metaSymbol } = useShortcuts()
<template>
<div class="flex items-center gap-0.5">
<UKbd>{{ metaSymbol }}</UKbd>
<UKbd>U</UKbd>
<UKbd>K</UKbd>
</div>
</template>
```