<BaseKbd /> · An abstraction of a keyboard key.
<template>
<div class="flex items-center gap-1">
<BaseKbd
variant="default"
size="md"
>
⌘
</BaseKbd>
+
<BaseKbd
variant="default"
size="md"
>
<span class="px-1">k</span>
</BaseKbd>
</div>
</template>
This component can have any children inside its default slot. You can use the provided slots to create a custom kbd element
<template>
<BaseKbd>
<!-- Your custom content here -->
</BaseKbd>
</template>
This component has props that you can use to modify its visual style.
| Prop | Type |
|---|---|
variantdefault: "default" | "default" | "none" | "muted"The variant of the kbd. |
sizedefault: "md" | "md" | "sm" | "lg"The size of the kbd. |
as-childdefault: - | booleanChange the default rendered element for the one passed as a child, merging their props and behavior. Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details. |
asdefault: "kbd" | AsTag | ComponentThe element or component this component should render as. Can be overwritten by `asChild`. |
| Slot | Type |
|---|---|
#default | any |