Skip to content
loseta

Components / Conversation

Message

A conversation row with avatar, header, content and footer.

Status stableWorks with avatar, bubble
CN
shadcn
How can I help you today?
10:42 AM
<article class="message" data-align="start">
  <div data-slot="avatar">
    <span class="avatar" data-size="sm">
      <span data-slot="fallback">CN</span>
    </span>
  </div>
  <div data-slot="content">
    <div data-slot="header">shadcn</div>
    <div class="bubble" data-variant="muted">
      <div data-slot="content">How can I help you today?</div>
    </div>
    <div data-slot="footer">10:42 AM</div>
  </div>
</article>

Installation

pnpm dlx loseta add message
npx loseta add message

Examples

Conversation

CN
shadcn
How can I help you today?
10:42 AM
YO
You
Add a calendar and a date picker to the docs.
Delivered
<div class="message-group" role="log" aria-label="Conversation">
  <article class="message" data-align="start">
    <div data-slot="avatar">
      <span class="avatar" data-size="sm">
        <span data-slot="fallback">CN</span>
      </span>
    </div>
    <div data-slot="content">
      <div data-slot="header">shadcn</div>
      <div class="bubble" data-variant="muted">
        <div data-slot="content">How can I help you today?</div>
      </div>
      <div data-slot="footer">10:42 AM</div>
    </div>
  </article>
  <article class="message" data-align="end">
    <div data-slot="avatar">
      <span class="avatar" data-size="sm">
        <span data-slot="fallback">YO</span>
      </span>
    </div>
    <div data-slot="content">
      <div data-slot="header">You</div>
      <div class="bubble">
        <div data-slot="content">Add a calendar and a date picker to the docs.</div>
      </div>
      <div data-slot="footer">Delivered</div>
    </div>
  </article>
</div>

Accessibility and behavior

  • A presentational row. Avatar, header, content and footer use data-slot; data-align="start|end" controls the side. Compose the surface with bubble and give a message group an accessible name.

Files

components/message.cssbase
styles/nova/message.cssstyle

Install contract

The CLI writes the base file under components/, the visual file for the selected style under styles/<name>/, and any primitive dependency underprimitives/. The generated index.css imports them in the right layer order.

← Back to components

loseta is MIT licensed. Built with native CSS, no runtime. Inspired byshadcn/ui.