AI Response Cards
Multiple response options carousel with swipeable cards, tone variants (professional, casual, creative, concise, detailed), and confidence scores. Lets users choose the best AI response for their needs.
Preview - Carousel Variant
Swipeable carousel with navigation
Professional
1 of 4
Here is a professional response tailored to your business needs. This approach focuses on clear communication and measurable outcomes.
Stack Variant
All responses visible in a vertical stack
Professional
This is the recommended approach based on industry best practices and your specific requirements.
Casual
Here's an alternative approach that might work better for your use case.
Grid Variant
2-column grid layout for quick comparison
Without Navigation
Minimal carousel without arrows
Professional
1 of 4
Here is a professional response tailored to your business needs. This approach focuses on clear communication and measurable outcomes.
Props
AIResponseCards component API reference
| Prop | Type | Default | Description |
|---|---|---|---|
responses* | AIResponseOption[] | — | Array of response options |
selectedId | string | — | Currently selected response ID |
onSelect | (responseId: string) => void | — | Callback when a response is selected |
onCopy | (responseId: string) => void | — | Callback when user copies a response |
onRegenerate | () => void | — | Callback when user wants to regenerate |
onFeedback | (responseId: string, positive: boolean) => void | — | Callback for feedback (thumbs up/down) |
showNavigation | boolean | true | Show navigation arrows |
showIndicators | boolean | true | Show response indicators (dots) |
enableSwipe | boolean | true | Enable swipe navigation |
autoSelect | boolean | false | Auto-select first response |
variant | 'carousel' | 'stack' | 'grid' | 'carousel' | Display variant |
className | string | — | Additional CSS classes |
AIResponseOption Type
| Prop | Type | Default | Description |
|---|---|---|---|
id* | string | — | Unique identifier |
content* | string | — | Response content |
tone | 'professional' | 'casual' | 'creative' | 'concise' | 'detailed' | — | Tone/style of this response |
label | string | — | Custom label for this option |
confidence | number | — | Confidence score (0-100) |
icon | LucideIcon | — | Icon for this response type |
color | string | — | Color accent classes |
tags | string[] | — | Tags or categories |
Usage
Import and implementation example
import { AIResponseCards } from '@/blocks/ai-transparency/ai-response-cards'import { useState } from 'react'
export default function Example() { const [selected, setSelected] = useState<string>()
const responses = [ { id: '1', content: 'Professional response with formal tone...', tone: 'professional', confidence: 92, tags: ['Business', 'Formal'], }, { id: '2', content: 'Casual, friendly response...', tone: 'casual', confidence: 88, }, { id: '3', content: 'Brief, to-the-point answer', tone: 'concise', confidence: 95, }, ]
return ( <AIResponseCards responses={responses} selectedId={selected} onSelect={setSelected} variant="carousel" onCopy={(id) => { console.log('Copied response:', id) }} onFeedback={(id, positive) => { console.log(`Feedback for ${id}: ${positive ? 'positive' : 'negative'}`) }} onRegenerate={() => { console.log('Generate new responses') }} /> )}Features
Built-in functionality
- Three display variants: Carousel, stack, or grid layout
- Five tone options: Professional, casual, creative, concise, detailed
- Swipe navigation: Touch-friendly swipe on carousel variant
- Confidence scores: Show AI confidence for each response
- Copy to clipboard: One-click copy with visual feedback
- Thumbs feedback: Rate responses with thumbs up/down
- Regenerate option: Request new response variations
- Tag system: Categorize responses with custom tags
- Selection state: Clear visual indication of selected response
- Dark mode support: Full dark mode with proper contrast
Response Tone Options
Built-in tone configurations
Professional
Formal, business-appropriate tone. Best for work-related content, reports, and formal communication.
Casual
Friendly, conversational tone. Great for approachable content and everyday communication.
Creative
Imaginative, out-of-the-box thinking. Ideal for brainstorming and innovative solutions.
Concise
Brief, direct answers. Perfect when you need quick, to-the-point information.
Detailed
Comprehensive, in-depth explanations. Best for learning and understanding complex topics.
Accessibility
ARIA support and keyboard navigation
ARIA Attributes
Response cards are keyboard accessibleCopy and feedback buttons have clear labelsSelected state is visually distinctKeyboard Navigation
| Key | Action |
|---|---|
| Tab | Navigate between responses and actions |
| Arrow Left/Right | Navigate carousel (carousel variant) |
| Enter / Space | Select response or activate button |
Notes
- Confidence scores should be announced to screen readers
- Copy action should provide confirmation feedback
- Tone indicators help users understand response style
- Tags provide additional context for each response