ReScript Shadcn
Get started
  • Installation
Components
  • Accordion
  • Alert
  • AlertDialog
  • AspectRatio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • ContextMenu
  • DataTable
  • DatePicker
  • Dialog
  • Direction
  • Drawer
  • DropdownMenu
  • Empty
  • Field
  • HoverCard
  • Input
  • InputGroup
  • InputOtp
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • MessageScroller
  • NativeSelect
  • NavigationMenu
  • Pagination
  • Popover
  • Progress
  • RadioGroup
  • Resizable
  • ScrollArea
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • ToggleGroup
  • Tooltip
  • Typography

Bubble

Displays conversational content in a message bubble.

I checked the registry output and found one stale dependency.
Remove it and rerun the build.
+1

The Bubble component displays framed conversational content. Use it for chat text, short structured output, suggestions, and reactions. For full message rows with avatars or metadata, compose it inside Message.

Installation#

npx shadcn@latest add @rescript-shadcn/Bubble

Usage#

<Bubble variant=Muted>
  <Bubble.Content>
    {"I checked the registry output and removed the stale route."->React.string}
  </Bubble.Content>
  <Bubble.Reactions>
    <span> {"+1"->React.string} </span>
  </Bubble.Reactions>
</Bubble>

Composition#

Bubble
├── Bubble.Content
└── Bubble.Reactions

Use Bubble.Group to group consecutive bubbles from the same sender.

Features#

  • Seven visual variants, from strong primary content to unframed ghost content
  • Start and end alignment for sender and receiver bubbles
  • Reactions that anchor to the bubble edge
  • Bubbles size to their content, up to the style-defined max width
  • Custom styling through className on every part

Examples#

Variants#

Use variant to change the visual treatment of the bubble.

Default bubble for the current user.
Secondary bubble for conversation content.
Muted bubble for quiet supporting details.
Outline bubble for framed content.
Ghost bubbles work well for assistant text that should use the full row.

Group#

Use Bubble.Group to stack consecutive bubbles from the same sender.

I finished the audit pass.
The registry output is clean now.
Great, ship that patch.
Then update the docs.

Reactions#

Use Bubble.Reactions for reaction summaries or quick action buttons.

Classname parity is passing.
+1reviewed
Run the pixel test too.

Accessibility#

When reactions are plain emoji, group them with role="img" and an ariaLabel so assistive technology announces the reaction summary once. When reactions are interactive, render buttons with icon labels.

API Reference#

Bubble#

PropTypeDefault
variantDefault | Secondary | Muted | Tinted | Outline | Ghost | DestructiveDefault
alignStart | EndStart
classNamestring-

Bubble.Reactions#

PropTypeDefault
sideTop | BottomBottom
alignStart | EndEnd
classNamestring-
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-8">
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-5">
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-8">
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-12">