---
title: Badge
description: Displays a badge or a component that looks like a badge.

link:
  doc: https://kobalte.dev/docs/core/components/badge
  api: https://kobalte.dev/docs/core/components/badge#api-reference
---

<ComponentPreview name="badge-demo">

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

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

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

  <ComponentSourceTabs>

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

    ```

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

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import { Badge } from "@/components/ui/badge"
```

```tsx
<Badge />
```

## Examples

### Secondary

<ComponentPreview name="badge-secondary-demo" >

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

```

</ComponentPreview>

### Destructive

<ComponentPreview name="badge-destructive-demo" >

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

```

</ComponentPreview>

### Outline

<ComponentPreview name="badge-outline-demo" >

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

```

</ComponentPreview>
