# Two-sided conversation

> Incoming and outgoing rows separated by nothing but the align prop.

A shadcn/ui block from the [@tealmac](https://ui.tealmac.com/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/tealmac/message-two-sided-chat).

- Page, with a live preview: https://shadcn.exchange/r/tealmac/message-two-sided-chat
- Screenshot: https://shadcn.exchange/shot/tealmac/message-two-sided-chat/light.png
- Registry item: https://ui.tealmac.com/r/message-two-sided-chat.json
- Listed: 2026-11-01, source last changed 2026-11-01

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/tealmac/message-two-sided-chat.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `bubble`, `message`

## Files

### `registry/patterns/message-two-sided-chat/message-two-sided-chat.tsx`

```tsx
/**
 * Two-sided conversation - adapted for tealmac UI from the ReUI example "c-message-1"
 * (https://github.com/keenthemes/reui), MIT License, Copyright (c) 2025
 * Keenthemes Inc. The full licence text is in THIRD_PARTY_NOTICES.md.
 * Changes: tealmac UI import paths and theme tokens, lucide icons, logical
 * (RTL-safe) spacing and alignment, reduced-motion support and sample
 * content.
 */
import { Bubble, BubbleContent } from "@/components/ui/bubble"
import { Message, MessageContent } from "@/components/ui/message"

/*
 * align="end" is the whole mechanism for an outgoing turn: Message writes it
 * out as data-align and reverses its own flex row, so no ms-auto is needed.
 */
export function MessageTwoSidedChat() {
  return (
    <div className="mx-auto flex w-full max-w-sm flex-col gap-6">
      <Message>
        <MessageContent>
          <Bubble variant="muted">
            <BubbleContent>
              Staging is green on 4.2. Want me to promote it?
            </BubbleContent>
          </Bubble>
        </MessageContent>
      </Message>

      {/*
        Side alone is the first cue lost when a thread is read aloud or
        collapsed into one column, so the bubble variant carries it too.
      */}
      <Message align="end">
        <MessageContent>
          <Bubble>
            <BubbleContent>
              Hold it. The billing migration has to go out in the same release.
            </BubbleContent>
          </Bubble>
        </MessageContent>
      </Message>

      <Message>
        <MessageContent>
          <Bubble variant="muted">
            <BubbleContent>
              Understood. The migration lands after the 2pm review.
            </BubbleContent>
          </Bubble>
        </MessageContent>
      </Message>

      <Message align="end">
        <MessageContent>
          <Bubble>
            <BubbleContent>
              Then I will cut the tag straight after.
            </BubbleContent>
          </Bubble>
        </MessageContent>
      </Message>
    </div>
  )
}
```
