

<Demo name="bubble/demos/bubble" />

## Installation [#installation]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npx shadcn@latest add @dotui/bubble
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm dlx shadcn@latest add @dotui/bubble
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn dlx shadcn@latest add @dotui/bubble
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun x shadcn@latest add @dotui/bubble
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Usage [#usage]

```tsx
import { Bubble, BubbleContent } from "@/ui/bubble"
```

```tsx
<Bubble align="end">
  <BubbleContent>Shipping it this week 🚀</BubbleContent>
</Bubble>
```

## Anatomy [#anatomy]

`Bubble` positions one message on a side of the conversation and styles the
`BubbleContent` inside it — `variant` picks the surface (primary, neutral,
muted, tinted, outline, ghost or danger), `align` picks the side. Consecutive
bubbles from the same sender stack inside a `BubbleGroup`, and
`BubbleReactions` pins emoji reactions to a corner of the bubble.

```tsx
import {
  Bubble,
  BubbleContent,
  BubbleGroup,
  BubbleReactions,
} from "@/ui/bubble"
```

```tsx
<BubbleGroup>
  <Bubble variant="muted">
    <BubbleContent>We just passed 10k stars!</BubbleContent>
    <BubbleReactions>🎉 3</BubbleReactions>
  </Bubble>
</BubbleGroup>
```

## Examples [#examples]

<Examples className="md:grid-cols-2">
  <Example name="bubble/demos/variants" title="Variants" />

  <Example name="bubble/demos/reactions" title="Reactions" />
</Examples>

## API Reference [#api-reference]

### BubbleGroup [#bubblegroup]

<Reference name="bubble-group" />

### Bubble [#bubble]

<Reference name="bubble" />

### BubbleContent [#bubblecontent]

<Reference name="bubble-content" />

### BubbleReactions [#bubblereactions]

<Reference name="bubble-reactions" />
