Skip to main content

Overview

The CometChatGroupItem component renders a single group entry within a list. It displays the group’s icon/avatar, name, type indicator (public, private, password-protected), and member count. The component supports custom templates for all visual sections, integrates a context menu for group-specific actions, and provides full keyboard accessibility with ARIA support.

Key Features

  • State Management: Active, selected, and focused states with distinct visual styling
  • Group Avatar: Displays the group icon with a group type indicator badge
  • Member Count: Shows the localized member count below the group name
  • Custom Templates: Template projection for leading, title, subtitle, and trailing sections
  • Context Menu: Configurable context menu options that appear on hover or focus
  • Keyboard Accessibility: Full keyboard support with Enter, Space, and Shift+F10 shortcuts
  • Global Config Priority: Supports a three-tier priority system (Input > GlobalConfig > Default)
Live Preview — default group item preview. Open in Storybook ↗

Basic Usage

Properties

Events

Customization

CSS Variable Overrides

The component uses CometChat CSS variables for theming. Override them on the host element or a parent wrapper:

Custom Templates

Provide custom templates via inputs to override any visual section:

Accessibility

Keyboard Navigation

ARIA Attributes

  • role="option" on the item container
  • aria-selected reflects the current selection state
  • aria-label combines the group name, type, and member count for screen readers
  • Proper tabindex management via roving tabindex pattern

Focus Management

  • Visible focus indicator meeting WCAG contrast requirements
  • Mouse clicks prevent focus outline (focus ring only appears for keyboard navigation)
  • Roving tabindex pattern for efficient list navigation
  • itemFocus output enables parent list to track focus position