# Kbd

A key cap for a shortcut, alone or as a group of keys.

Section: Components / Data display
Page: https://ui.heyramzi.com/components/kbd
Import path: `@heyramzi/ui/shadcn/kbd`

## Import

```ts
import { Kbd, KbdGroup } from "@heyramzi/ui/shadcn/kbd";
```

## Usage

```svelte
<KbdGroup>
  <Kbd>⌘</Kbd>
  <Kbd>K</Kbd>
</KbdGroup>
<p>Press <Kbd>Esc</Kbd> to close.</p>
```

## Demo

```svelte
<script lang="ts">
	import { Kbd, KbdGroup } from "@heyramzi/ui/shadcn/kbd";
</script>

<div class="flex flex-col items-center gap-5 text-sm">
	<KbdGroup>
		<Kbd>⌘</Kbd>
		<Kbd>K</Kbd>
	</KbdGroup>

	<p class="text-muted-foreground">
		Press <Kbd>Esc</Kbd> to close, <Kbd>↑</Kbd>
		<Kbd>↓</Kbd> to move and <Kbd>↵</Kbd> to open.
	</p>
</div>
```

## API

### Kbd.Root

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLElement>` from `svelte/elements`.

### Kbd.Group

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLElement>` from `svelte/elements`.
