---
title: Button
description: Displays a button or a component that looks like a button.

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

<ComponentPreview name="button-demo">

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

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

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

  <ComponentSourceTabs>

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

    ```

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

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import { Button } from "@/components/ui/button"
```

```tsx
<Button />
```

## Examples

### Destructive

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

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

```

</ComponentPreview>

### Ghost

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

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

```

</ComponentPreview>

### With Icon

<ComponentPreview name="button-left-icon-demo">

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

```

</ComponentPreview>

### Loading

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

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

```

</ComponentPreview>

### Outline

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

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

```

</ComponentPreview>

### Secondary

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

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

```

</ComponentPreview>
