TheDocumentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
CometChatDeleteBubble component is a simple presentational Angular component that displays a placeholder indicating a message has been deleted. Unlike other message bubble components, it does NOT accept a CometChat message object - only simple inputs for styling and text customization.
Overview
The Delete Bubble component provides a clear visual indicator that a message was deleted, with support for both sender (outgoing) and receiver (incoming) styling variants:- Delete Icon Display: Shows a recognizable delete/trash icon
- Localized Default Text: Displays “This message was deleted” in the user’s language
- Custom Text Support: Allows overriding the default text
- Sender/Receiver Variants: Different styling for outgoing vs incoming messages
- Full Accessibility Support: ARIA role and labels for screen readers
- CSS Variable-Based Theming: Easy customization via CSS variables
Live Preview — Default delete bubble preview.
Open in Storybook ↗
Basic Usage
Simple Delete Bubble (Receiver Variant)
Sender Variant (Outgoing Message)
Custom Text
Incoming vs Outgoing Messages
Properties
| Property | Type | Default | Description |
|---|---|---|---|
isSentByMe | boolean | false | Determines sender (outgoing) or receiver (incoming) styling. When true, applies primary color background with white text/icon. When false, applies neutral background with neutral text/icon |
text | string | undefined | Optional custom text to display instead of the default localized text. If not provided, uses the “message_deleted” localization key |
Customization
Styling with CSS Variables
The Delete Bubble component uses CSS variables exclusively for easy customization:Available CSS Variables
| Variable | Purpose | Default |
|---|---|---|
--cometchat-spacing-1 | Gap between icon and text | 4px |
--cometchat-spacing-2 | Container padding | 8px |
--cometchat-font-body-regular | Text font style | 400 14px/16.8px Roboto |
--cometchat-primary-color | Sender variant background | #6852D6 |
--cometchat-static-white | Sender variant text/icon color | #FFFFFF |
--cometchat-neutral-color-300 | Receiver variant background | #E8E8E8 |
--cometchat-neutral-color-600 | Receiver variant text/icon color | #727272 |
--cometchat-radius-3 | Border radius | 12px |
Custom Color Schemes
Custom Icon Styling
The delete icon uses CSS mask technique, allowing color customization via the background property:Accessibility
The Delete 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 displayed text
- ✅ 1.3.1 Info and Relationships (Level A): Proper semantic structure with role=“status”
- ✅ 1.4.3 Contrast (Minimum) (Level AA): Sufficient color contrast for text readability
- ✅ 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 | Displayed text | Provides accessible name for screen readers |
aria-hidden | Icon | "true" | Hides decorative icon from screen readers |
Screen Reader Behavior
Screen readers announce the delete bubble as a status message with the displayed text (either the localized default “This message was deleted” or custom text). Therole="status" attribute ensures that screen readers treat this as an informational message rather than interactive content.
Color Contrast
Both sender and receiver variants maintain sufficient color contrast:- Sender variant: White text on primary color background (typically purple #6852D6)
- Receiver variant: Neutral-600 text on neutral-300 background
Best Practices
The default text is automatically localized. Only provide custom text via the
text input if you need to override the default message.Related Components
- CometChatActionBubble: Displays action/system messages
- CometChatTextBubble: Displays text messages
- CometChatMessageList: Displays lists of messages including deleted message placeholders
Technical Details
- Standalone Component: Can be imported and used independently
- Change Detection: Uses OnPush change detection strategy for optimal performance
- Dependencies: Uses CometChatLocalize for default text localization
- Bundle Size: Minimal footprint (~2KB)
- BEM CSS: Follows Block Element Modifier naming convention
- Accessibility: WCAG 2.1 Level AA compliant
- Max Width: 270px to maintain consistent bubble sizing