CometChatReactionList component displays all users who have reacted to a message. It groups reactions by emoji type and allows filtering by specific emoji, providing a comprehensive view of message reactions with pagination support.
Overview
The Reaction List component provides a detailed view of message reactions:- Emoji Tabs: Filter reactions by specific emoji or view all reactions
- User Display: Shows avatar, name, and reaction emoji for each user
- Current User Highlighting: Highlights the logged-in user’s reactions with removal hint
- Pagination: Automatically loads more reactions when scrolling
- Keyboard Navigation: Full keyboard accessibility for tabs and items
- Click Handling: Emits events when reaction items are clicked (useful for removing own reactions)
- Loading & Error States: Displays appropriate states during data fetching
Live Preview — default reaction list preview.
Open in Storybook ↗
Reaction List Structure
The Reaction List component has a tabbed interface with a scrollable list:Basic Usage
Simple Reaction List
With Custom Reactions Request Builder
API Reference
Properties
Events
Customization
CSS Variables
The Reaction List component uses CSS variables for styling. You can customize its appearance by overriding these variables:Theming
The component automatically adapts to light and dark themes through CSS variables:Custom Reaction List Container
If you need complete control over the reaction list presentation, you can wrap it in a custom container:Accessibility
The Reaction List component is built with accessibility in mind:Keyboard Navigation
ARIA Attributes
Screen Reader Support
The component provides descriptive labels for screen readers:- Tab labels include emoji and count (e.g., ”👍 3 reactions”)
- Reaction items announce user name and emoji
- Current user items include removal hint
- Loading and error states are announced via
aria-live
Best Practices
Performance Considerations
- Pagination: The component automatically paginates reactions. The default limit is 10 reactions per page.
- Lazy Loading: Reactions are loaded on scroll, reducing initial load time.
- Change Detection: Uses
OnPushchange detection strategy for optimal performance.
UX Recommendations
- Clear Removal Action: When displaying the current user’s reactions, clearly indicate they can click to remove.
- Loading Feedback: Show loading indicators when fetching reactions.
- Error Handling: Provide retry functionality when errors occur.
- Mobile Optimization: Use bottom sheet presentation on mobile devices.
Integration Tips
- Popover Positioning: Position the reaction list near the message for context.
- Dismiss on Outside Click: Close the reaction list when clicking outside.
- Keyboard Escape: Allow closing with the Escape key.
- Real-time Updates: Listen for reaction events to update the list in real-time.
Related Components
- CometChatMessageList - Parent component that displays messages with reactions
- CometChatMessageBubble - Message container with reaction display
- CometChatEmojiKeyboard - Emoji picker for adding reactions
- CometChatPopover - Popover component for displaying reaction list