TheDocumentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
CometChatActionBubble component is a simple presentational Angular component that displays action/system messages in a chat interface. These are messages like “User joined the group”, “User left the group”, or “Group name changed to X”.
Overview
Unlike regular message bubbles that are aligned left (receiver) or right (sender), action bubbles are centered and have a subtle, pill-shaped appearance. The component is purely presentational and does NOT accept a CometChat message object - only a plain text string. Key features:- Simple Text Display: Accepts a single text input for the action message
- Centered Layout: Pill-shaped container with subtle styling
- Hidden Icon Element: Available for CSS customization if needed
- Full Accessibility Support: ARIA role and labels for screen readers
- CSS Variable-Based Theming: Easy customization via CSS variables
Live Preview — Default action bubble preview.
Open in Storybook ↗
Basic Usage
Simple Action Message
Various Action Message Types
Properties
| Property | Type | Default | Description |
|---|---|---|---|
messageText | string | '' | The action/system message text to display. If empty, null, undefined, or whitespace-only, the component renders nothing |
iconUrl | string | '' | URL or path to an icon image displayed alongside the action text |
iconErrorColor | boolean | false | When true, applies error color styling to the icon (e.g., for missed call indicators) |
Empty State Handling
The component gracefully handles empty or invalid inputs by not rendering any content:Customization
Styling with CSS Variables
The Action Bubble component uses CSS variables exclusively for easy customization:Available CSS Variables
| Variable | Purpose | Default |
|---|---|---|
--cometchat-spacing-1 | Vertical padding | 4px |
--cometchat-spacing-3 | Horizontal padding | 12px |
--cometchat-font-caption1-regular | Text font style | 400 12px/14.4px Roboto |
--cometchat-text-color-secondary | Text color | #666666 |
--cometchat-background-color-02 | Background color | #F5F5F5 |
--cometchat-border-color-default | Border color | #E0E0E0 |
--cometchat-radius-max | Border radius (pill shape) | 1000px |
Showing the Icon
The component includes a hidden icon element that can be shown via CSS customization:Custom Color Schemes
Accessibility
The Action Bubble component is fully accessible and follows WCAG 2.1 Level AA guidelines.WCAG 2.1 Compliance
The component meets the following WCAG 2.1 success criteria:- ✅ 1.1.1 Non-text Content (Level A): The container has an aria-label with the message text
- ✅ 1.3.1 Info and Relationships (Level A): Proper semantic structure with role=“status”
- ✅ 4.1.2 Name, Role, Value (Level A): All elements have accessible names and roles
ARIA Attributes
The component automatically applies appropriate ARIA attributes:| Attribute | Element | Value | Purpose |
|---|---|---|---|
role | Container | "status" | Indicates this is a status message |
aria-label | Container | Message text | Provides accessible name for screen readers |
aria-hidden | Icon | "true" | Hides decorative icon from screen readers |
Screen Reader Behavior
Screen readers announce the action bubble as a status message with the provided text content. Therole="status" attribute ensures that screen readers treat this as an informational message rather than interactive content.
Best Practices
The component automatically handles empty, null, undefined, and whitespace-only inputs by not rendering any content.
Related Components
- CometChatDeleteMessageBubble: Displays deleted message placeholders
- CometChatTextBubble: Displays text messages
- CometChatMessageList: Displays lists of messages including action bubbles
Technical Details
- Standalone Component: Can be imported and used independently
- Change Detection: Uses OnPush change detection strategy for optimal performance
- Dependencies: None (purely presentational)
- Bundle Size: Minimal footprint (~2KB)
- BEM CSS: Follows Block Element Modifier naming convention
- Accessibility: WCAG 2.1 Level AA compliant