Sentiment Alert

Sentiment Alert

AI
Feedback
Planned

Displays AI-detected sentiment analysis results as contextual alerts with severity levels and confidence scores.

Built With

2 components

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

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

PropTypeDefaultDescription
sentiment'positive' | 'negative' | 'neutral' | 'mixed'—Detected sentiment type
confidencenumber—Confidence score from 0 to 100
messagestring—Alert message text
sourcestring—Source of the analyzed text
onDismiss() => void—Callback when alert is dismissed
classNamestring—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 notifications

Keyboard Navigation

KeyAction
EscapeDismiss the alert (when dismissible)

Notes

  • Sentiment will be conveyed through both color and text
  • Confidence scores will be available as text, not only visual