Eidetic

AI Feedback Loop

AI
Trust
Governor

Collect user feedback on AI responses with multiple feedback types including thumbs up/down, star ratings, quick tags, and detailed comments. Enables continuous improvement of AI outputs.

Compact Variant

Minimal inline thumbs up/down

Was this helpful?

Inline - Thumbs

Thumbs feedback with expandable comments

Was this response helpful?

Inline - Star Rating

5-star rating system

Was this response helpful?

Quick Feedback Tags

Pre-defined feedback options

Was this response helpful?

Card with Suggestions

Full featured card with improvement suggestions

Was this response helpful?

Your feedback improves AI responses

Submitted State

Thank you message after submission

Thanks! Your feedback helps improve AI responses.

Props

AIFeedbackLoop component API reference

PropTypeDefaultDescription
type'thumbs' | 'rating' | 'detailed' | 'quick''thumbs'Type of feedback collection
quickOptionsFeedbackOption[]Quick feedback options for the quick type
showCategoriesbooleanfalseShow category selection (accuracy, helpfulness, etc)
allowCommentsbooleantrueAllow text comments
onFeedbackSubmit(feedback: FeedbackData) => voidCallback when feedback is submitted
submittedbooleanfalseWhether feedback has been submitted
thankYouMessagestring"Thanks for your feedback!"Message to show after submission
promptLabelstring"Was this response helpful?"Label for the feedback prompt
variant'inline' | 'card' | 'compact' | 'floating''inline'Display mode variant
showImprovementSuggestionsbooleanfalseShow improvement suggestions after negative feedback
improvementSuggestionsstring[]Suggestions for improvement
onRetryWithSuggestions(suggestions: string[]) => voidCallback when user requests retry with suggestions
loadingbooleanfalseLoading state
classNamestringAdditional CSS classes

FeedbackData Type

PropTypeDefaultDescription
sentiment'positive' | 'negative' | 'neutral'Overall feedback sentiment
ratingnumberStar rating (1-5)
categoriesFeedbackCategory[]Selected feedback categories
commentstringUser comment text
quickFeedbackstring[]Selected quick feedback option IDs
timestamp*DateWhen feedback was submitted

Usage

Import and implementation example

import { AIFeedbackLoop } from '@/blocks/ai-transparency/ai-feedback-loop'
export default function ChatMessage() {
const handleFeedback = (feedback) => {
console.log('User feedback:', feedback)
// Send to analytics or backend
// Update AI model based on feedback
}
const handleRetryWithSuggestions = (suggestions) => {
console.log('Retry with:', suggestions)
// Regenerate response with suggestions
}
return (
<div>
{/* Inline thumbs */}
<AIFeedbackLoop
type="thumbs"
variant="inline"
allowComments={true}
onFeedbackSubmit={handleFeedback}
/>
{/* Star rating */}
<AIFeedbackLoop
type="rating"
variant="card"
showCategories={true}
allowComments={true}
onFeedbackSubmit={handleFeedback}
/>
{/* With improvement suggestions */}
<AIFeedbackLoop
type="thumbs"
variant="card"
showImprovementSuggestions={true}
improvementSuggestions={[
'More examples',
'Simpler language',
'More details',
]}
onFeedbackSubmit={handleFeedback}
onRetryWithSuggestions={handleRetryWithSuggestions}
/>
</div>
)
}

Built With

3 components

This block uses the following UI components from the design system:

Features

Built-in functionality

  • Multiple feedback types: Thumbs, star rating, quick tags, and detailed feedback
  • Expandable comments: Optional text area for detailed feedback
  • Category selection: Pre-defined categories (accuracy, helpfulness, clarity, etc)
  • Improvement suggestions: Show actionable suggestions after negative feedback
  • Retry with feedback: Allow users to regenerate with selected improvements
  • Quick feedback options: Customizable quick-select buttons with icons
  • Sentiment tracking: Automatic sentiment classification
  • Thank you state: Confirmation message after submission
  • Compact mode: Minimal version for toolbars and tight spaces
  • Dark mode support: Full dark mode with proper contrast

Accessibility

ARIA support and keyboard navigation

ARIA Attributes

All interactive elements use semantic buttonsStar ratings use button elements with aria-labelForm inputs have proper labels

Keyboard Navigation

KeyAction
TabNavigate through feedback options
Enter / SpaceSelect feedback option
Arrow keysNavigate star rating

Notes

  • Color is not the only indicator - icons and text labels included
  • Loading states disable interactions to prevent double submission
  • Error states provide clear feedback
  • Consider adding aria-live regions for dynamic feedback