---
title: Kbd
description: Used to display textual user input from keyboard.
---

<ComponentPreview name="kbd-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/kbd-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/kbd" file=<rootDir>/apps/docs/src/registry/ui/kbd.tsx

    ```

    ```tsx title="components/ui/kbd" file=<rootDir>/apps/unocss-playground/src/registry/ui/kbd.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import { Kbd } from "@/components/ui/kbd"
```

```tsx
<Kbd>Ctrl</Kbd>
```

## Examples

### Group

Use the `KbdGroup` component to group keyboard keys together.

<ComponentPreview name="kbd-group-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/kbd-group-demo.tsx

```

</ComponentPreview>

### Button

Use the `Kbd` component inside a `Button` component to display a keyboard key inside a button.

<ComponentPreview name="kbd-button-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/kbd-button-demo.tsx

```

</ComponentPreview>
