Sentiment Alert
AI
Feedback
Planned
Displays AI-detected sentiment analysis results as contextual alerts with severity levels and confidence scores.
Preview
Component implementation pending
🚧
Component Under Development
A dismissible SentimentAlert with confidence and source is planned. The tone indicator is available today as SentimentAlertIndicator, see Blocks / Sentiment Alert.
Planned Props
Expected component API
| Prop | Type | Default | Description |
|---|---|---|---|
sentiment | 'positive' | 'negative' | 'neutral' | 'mixed' | — | Detected sentiment type |
confidence | number | — | Confidence score from 0 to 100 |
message | string | — | Alert message text |
source | string | — | Source of the analyzed text |
onDismiss | () => void | — | Callback when alert is dismissed |
className | string | — | Additional CSS classes |
Usage
Expected import and implementation
import { SentimentAlert } from '@/components/ui/sentiment-alert'
export default function Example() { return ( <SentimentAlert sentiment="negative" confidence={87} message="Negative sentiment detected in customer feedback" source="Support Ticket #1234" onDismiss={() => {}} /> )}Planned Features
Expected functionality
- Sentiment types: Positive, negative, neutral, and mixed sentiment detection
- Confidence score: Visual confidence indicator for the analysis
- Dismissible: Optional dismiss action for transient alerts
- Source attribution: Shows the source of the analyzed content
Accessibility
Accessibility considerations
ARIA Attributes
Will use role="alert" for important sentiment notificationsKeyboard Navigation
| Key | Action |
|---|---|
| Escape | Dismiss the alert (when dismissible) |
Notes
- Sentiment will be conveyed through both color and text
- Confidence scores will be available as text, not only visual