Overview
TheChatEmptyState component displays when the chat conversation is empty. It provides a welcoming introduction to the ADK Utils package, shows the agent branding, and presents interactive suggestion cards that users can click to start a conversation with pre-defined prompts.
Props
Callback function triggered when a user clicks one of the suggestion cards. Receives the prompt text as an argument that should be used to initiate the conversation.
TypeScript Interface
Usage
Features
Branding Section
- Bot Icon: Large (16x16) bot icon in an accent-colored circular container
- Title Text: Introduces the @yagolopez/adk-utils npm package with clickable link
- Subtitle: “Some prompt examples:” to introduce suggestion cards
- Centered Layout: Vertically and horizontally centered for visual balance
Suggestion Cards
The component displays suggestion cards in a responsive grid:- Mobile: Single column
- Desktop: 3-column grid
- Max Width: 28rem (448px) for optimal readability
- Icon (from Lucide icons library)
- Label (short title)
- Prompt preview (truncated to 2 lines)
- Tooltip with additional information
- Hover effects (border color change, background color change)
Suggestions Data
Suggestions are imported from@/lib/constants:
Visual Design
Layout Structure
Spacing
- Main container:
flex-1with centered content - Gap between sections: 2rem (32px)
- Gap between cards: 0.75rem (12px)
- Card padding: 1rem (16px)
Colors
- Bot icon container:
bg-accent/10withring-accent/20 - Card background:
bg-card - Card borders:
border-border - Hover state:
border-accent/50andbg-muted - Link color:
text-accent
Interactive Behavior
Card Click
- User clicks a suggestion card
onSuggestionClickis called with the prompt text- Parent component typically:
- Sets the input value to the prompt
- Optionally auto-submits the message
- Scrolls to input field
Tooltips
Each card has a tooltip that appears on hover:- Position: Bottom
- Content: Additional info about the suggestion
- Provided by
@/components/ui/tooltip
Accessibility
- Semantic HTML: Uses
<button>for interactive cards - External link attributes:
target="_blank" rel="noopener noreferrer" - Hover states: Clear visual feedback
- Focus states: Inherited from UI components
Responsive Design
Text Clamping
Prompt preview text usesline-clamp-2 to truncate long prompts to 2 lines, maintaining card height consistency.
Related Components
ChatHeader
Header with similar suggestion functionality
ChatInput
Input component to receive suggestion text