// Generated by scripts/generate-showcase.mjs. Do not edit directly. page ChatBubbleDetail { layout = "showcase" state playground_size = ctx.url.searchParams.get("pg_size") ?? "default" state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary" state playground_title = ctx.url.searchParams.get("pg_title") ?? "" state playground_description = ctx.url.searchParams.get("pg_description") ?? "" state playground_items = JSON.parse(ctx.url.searchParams.get("pg_items") ?? "[{\"text\":\"Hi Maya, is the new dashboard ready to review?\",\"direction\":\"incoming\",\"timestamp\":\"10:24\"},{\"text\":\"Yes! I have shared the latest version with you.\",\"direction\":\"outgoing\",\"timestamp\":\"10:25\",\"receipt\":\"read\"},{\"text\":\"Thanks, I will take a look this afternoon.\",\"direction\":\"incoming\",\"timestamp\":\"10:26\"},{\"text\":\"Great. The release notes are attached too.\",\"direction\":\"outgoing\",\"timestamp\":\"10:27\",\"receipt\":\"delivered\"},{\"text\":\"One more screenshot coming up.\",\"direction\":\"outgoing\",\"timestamp\":\"10:28\",\"receipt\":\"sent\"},{\"text\":\"Uploading the final export now.\",\"direction\":\"outgoing\",\"timestamp\":\"10:29\",\"receipt\":\"sending\"},{\"text\":\"Here is the invoice PDF.\",\"direction\":\"outgoing\",\"timestamp\":\"10:30\",\"receipt\":\"failed\",\"status\":\"Not delivered\",\"actionLabel\":\"Retry\"}]") state playground_oneSided = (ctx.url.searchParams.get("pg_oneSided") ?? "false") === "true" state playground_showAvatars = (ctx.url.searchParams.get("pg_showAvatars") ?? "false") === "true" state playground_showMetadata = (ctx.url.searchParams.get("pg_showMetadata") ?? "true") === "true" state playground_ariaLabel = ctx.url.searchParams.get("pg_ariaLabel") ?? "Conversation" state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "default" state playground_class = ctx.url.searchParams.get("pg_class") ?? "" seo { title = "Chat Bubble" description = "Theme-aware, responsive chat bubble component." } view {
Base component

Chat Bubble

Theme-aware, responsive chat bubble component.

11 props1 slots4 outputsTheme readyResponsive
Interactive playground

Configure Chat Bubble

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
page ChatBubbleExample {
  state items = [
  {
    "text": "Hi Maya, is the new dashboard ready to review?",
    "direction": "incoming",
    "timestamp": "10:24"
  },
  {
    "text": "Yes! I have shared the latest version with you.",
    "direction": "outgoing",
    "timestamp": "10:25",
    "receipt": "read"
  },
  {
    "text": "Thanks, I will take a look this afternoon.",
    "direction": "incoming",
    "timestamp": "10:26"
  },
  {
    "text": "Great. The release notes are attached too.",
    "direction": "outgoing",
    "timestamp": "10:27",
    "receipt": "delivered"
  },
  {
    "text": "One more screenshot coming up.",
    "direction": "outgoing",
    "timestamp": "10:28",
    "receipt": "sent"
  },
  {
    "text": "Uploading the final export now.",
    "direction": "outgoing",
    "timestamp": "10:29",
    "receipt": "sending"
  },
  {
    "text": "Here is the invoice PDF.",
    "direction": "outgoing",
    "timestamp": "10:30",
    "receipt": "failed",
    "status": "Not delivered",
    "actionLabel": "Retry"
  }
]
  view {
    <ChatBubble
      items="{items}"
      showMetadata="true"
    />
  }
}
Event outputInteract with the preview to inspect the typed payload.
Component props11 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Production default

Balanced spacing, hierarchy, and content for the most common product workflow.

01
Live preview
Component usage.wrn
page ChatBubbleExample {
  state items = [
  {
    "text": "Hi Maya, is the new dashboard ready to review?",
    "direction": "incoming",
    "timestamp": "10:24"
  },
  {
    "text": "Yes! I have shared the latest version with you.",
    "direction": "outgoing",
    "timestamp": "10:25",
    "receipt": "read"
  },
  {
    "text": "Thanks, I will take a look this afternoon.",
    "direction": "incoming",
    "timestamp": "10:26"
  },
  {
    "text": "Great. The release notes are attached too.",
    "direction": "outgoing",
    "timestamp": "10:27",
    "receipt": "delivered"
  },
  {
    "text": "One more screenshot coming up.",
    "direction": "outgoing",
    "timestamp": "10:28",
    "receipt": "sent"
  },
  {
    "text": "Uploading the final export now.",
    "direction": "outgoing",
    "timestamp": "10:29",
    "receipt": "sending"
  },
  {
    "text": "Here is the invoice PDF.",
    "direction": "outgoing",
    "timestamp": "10:30",
    "receipt": "failed",
    "status": "Not delivered",
    "actionLabel": "Retry"
  }
]
  view {
    <ChatBubble
      items="{items}"
      showMetadata="true"
    />
  }
}
Dense UI

Compact application

A tighter variation for dashboards, side panels, tables, and operational interfaces.

02
Live preview
Component usage.wrn
page ChatBubbleExample {
  state items = [
  {
    "text": "Hi Maya, is the new dashboard ready to review?",
    "direction": "incoming",
    "timestamp": "10:24"
  },
  {
    "text": "Yes! I have shared the latest version with you.",
    "direction": "outgoing",
    "timestamp": "10:25",
    "receipt": "read"
  },
  {
    "text": "Thanks, I will take a look this afternoon.",
    "direction": "incoming",
    "timestamp": "10:26"
  },
  {
    "text": "Great. The release notes are attached too.",
    "direction": "outgoing",
    "timestamp": "10:27",
    "receipt": "delivered"
  },
  {
    "text": "One more screenshot coming up.",
    "direction": "outgoing",
    "timestamp": "10:28",
    "receipt": "sent"
  },
  {
    "text": "Uploading the final export now.",
    "direction": "outgoing",
    "timestamp": "10:29",
    "receipt": "sending"
  },
  {
    "text": "Here is the invoice PDF.",
    "direction": "outgoing",
    "timestamp": "10:30",
    "receipt": "failed",
    "status": "Not delivered",
    "actionLabel": "Retry"
  }
]
  view {
    <ChatBubble
      items="{items}"
      showMetadata="true"
    />
  }
}
Extended

Rich configuration

A more expressive variation using additional data, stronger emphasis, and optional states.

03
Live preview
Component usage.wrn
page ChatBubbleExample {
  state items = [
  {
    "text": "Hi Maya, is the new dashboard ready to review?",
    "direction": "incoming",
    "timestamp": "10:24"
  },
  {
    "text": "Yes! I have shared the latest version with you.",
    "direction": "outgoing",
    "timestamp": "10:25",
    "receipt": "read"
  },
  {
    "text": "Thanks, I will take a look this afternoon.",
    "direction": "incoming",
    "timestamp": "10:26"
  },
  {
    "text": "Great. The release notes are attached too.",
    "direction": "outgoing",
    "timestamp": "10:27",
    "receipt": "delivered"
  },
  {
    "text": "One more screenshot coming up.",
    "direction": "outgoing",
    "timestamp": "10:28",
    "receipt": "sent"
  },
  {
    "text": "Uploading the final export now.",
    "direction": "outgoing",
    "timestamp": "10:29",
    "receipt": "sending"
  },
  {
    "text": "Here is the invoice PDF.",
    "direction": "outgoing",
    "timestamp": "10:30",
    "receipt": "failed",
    "status": "Not delivered",
    "actionLabel": "Retry"
  }
]
  view {
    <ChatBubble
      items="{items}"
      showMetadata="true"
    />
  }
}
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@actionFires when the component's primary or item action is activated.
@messageClickFires when the component emits the messageClick event.
@avatarClickFires when the component emits the avatarClick event.
@linkClickFires when the component emits the linkClick event.
Declarative handlers.wrn
<ChatBubble
  @action='console.log(payload)'
  @messageClick='console.log(payload)'
  @avatarClick='console.log(payload)'
  @linkClick='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"ChatBubble\"], [data-component=\"ChatBubble\"]")

if (component) registerOutputHandler(component, "action", (payload) => {
  console.log("action", payload)
})

if (component) registerOutputHandler(component, "messageClick", (payload) => {
  console.log("messageClick", payload)
})

if (component) registerOutputHandler(component, "avatarClick", (payload) => {
  console.log("avatarClick", payload)
})

if (component) registerOutputHandler(component, "linkClick", (payload) => {
  console.log("linkClick", payload)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
sizestring"default"No
colorstring"primary"No
titlestring""No
descriptionstring""No
itemsunknown[][]No
oneSidedbooleanfalseNo
showAvatarsbooleanfalseNo
showMetadatabooleanfalseNo
ariaLabelstring"Conversation"No
variantstring"default"No
classstring""No
} }