Data display
Layout
Kbd
A keyboard key or shortcut, styled like a physical key. Use it in hints and help text.
Install
import { Kbd } from 'vael-ui'Playground
⌘K
Usage
<script setup lang="ts">
import { Kbd } from 'vael-ui'
</script>
<template>
<Kbd>⌘K</Kbd>
</template>Motion New
Kbd: its appearance.
<Kbd
:motion="{ initial: { root: { opacity: 0, y: 4 } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | root | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
It has no keyboard interaction of its own.
- Kbd renders a native
<kbd>element with no role and no keyboard handling. Screen readers read the text you put in it.