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
Customization
Styling with CSS Variables
The Delete Bubble component uses CSS variables exclusively for easy customization:Available CSS Variables
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: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