Skip to main content

Overview

The CometChatGroupMemberItem component renders a single group member entry within a member list. It displays the member’s avatar, name, online/offline status indicator, and a role badge (owner, admin, moderator). The component supports custom templates for all visual sections, integrates a context menu for member-specific actions (kick, ban, change scope), and provides full keyboard accessibility with ARIA support.

Key Features

  • State Management: Active, selected, and focused states with distinct visual styling
  • Member Avatar: Displays the member’s avatar image with an online/offline status indicator
  • Role Badge: Shows the member’s scope/role (owner, admin, moderator) as a visual badge
  • Custom Templates: Template projection for leading, title, subtitle, and trailing sections
  • Context Menu: Configurable context menu options for member management (kick, ban, change scope) shown on hover or focus
  • Keyboard Accessibility: Full keyboard support with Enter and Space shortcuts
  • Global Config Priority: Supports a three-tier priority system (Input > GlobalConfig > Default)
Live Preview — default group member 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:

Context Menu for Member Management

Provide context menu options for common member management actions:

Accessibility

Keyboard Navigation

Context menu options are shown on hover or focus; there is no keyboard shortcut that opens the menu.

ARIA Attributes

  • role="option" on the item container
  • aria-selected reflects the current selection state
  • aria-label combines the member name, scope/role, and online/offline status for screen readers
  • aria-hidden="true" on the scope badge (decorative; scope is included in the accessible label)
  • Proper tabindex management via roving tabindex pattern

Focus Management

  • Visible focus indicator with minimum 3:1 contrast ratio
  • 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
  • Scope change control is focusable via Tab