Skip to main content
The 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

  1. Pagination: The component automatically paginates reactions. The default limit is 10 reactions per page.
  2. Lazy Loading: Reactions are loaded on scroll, reducing initial load time.
  3. Change Detection: Uses OnPush change detection strategy for optimal performance.

UX Recommendations

  1. Clear Removal Action: When displaying the current user’s reactions, clearly indicate they can click to remove.
  2. Loading Feedback: Show loading indicators when fetching reactions.
  3. Error Handling: Provide retry functionality when errors occur.
  4. Mobile Optimization: Use bottom sheet presentation on mobile devices.

Integration Tips

  1. Popover Positioning: Position the reaction list near the message for context.
  2. Dismiss on Outside Click: Close the reaction list when clicking outside.
  3. Keyboard Escape: Allow closing with the Escape key.
  4. Real-time Updates: Listen for reaction events to update the list in real-time.