Skip to main content
The CometChatConversationStarter component displays AI-generated conversation starter suggestions as clickable chips. It integrates with the CometChat AI extension to generate up to 4 contextual prompts for starting a conversation.

Overview

The Conversation Starter component helps users initiate conversations:
  • AI-Generated Starters: Fetches up to 4 conversation starter suggestions from the CometChat AI extension
  • Context-Aware: Generates starters based on the user or group context provided
  • Loading State: Displays a loading indicator while fetching suggestions from the AI service
  • Error Handling: Manages error states gracefully when the AI service is unavailable
  • Keyboard Accessible: Full keyboard navigation with Tab, Enter/Space to select, and ArrowLeft/ArrowRight between starters with wrap-around
Live Preview — default conversation starter preview. Open in Storybook ↗

Basic Usage

With a User

With a Group

Properties

Events

Customization

CSS Variables

The Conversation Starter component uses BEM-style CSS classes that can be customized with CSS variables:

Accessibility

Keyboard Navigation

  • Tab: Focus moves into the conversation starters container and to the first starter chip
  • ArrowRight / ArrowLeft: Navigate between starter chips with wrap-around
  • Enter / Space: Select the focused starter chip, emitting the starterClick event
  • Focus is managed using a roving tabindex pattern

Screen Reader Support

  • The container has role="group" with aria-label="Conversation starters"
  • Each starter chip has an aria-label with the starter text
  • Screen readers announce “Conversation starters available” when the component appears