Anomaly Card
Alert card for unusual patterns requiring attention. Highlights deviations from typical work patterns with severity indicators and actionable recommendations.
Preview
Critical anomaly with full details
Unusually high task volume detected
You have 18 tasks due this week, 3x your typical workload. This represents a significant spike that may affect your productivity.
Severity Variants
All severity levels with appropriate visual indicators
Database latency spike
Response times have increased 400% in the last 5 minutes.
AI suggestion accuracy declining
Your acceptance rate for AI suggestions has dropped from 78% to 45% over the past week.
Different completion pattern
You're completing tasks earlier in the day than usual, shifting from afternoon to morning productivity.
Calendar sync delay detected
Calendar events are syncing 15% slower than usual. No impact on task management.
Anomaly Types
Different types of anomalies with context-specific icons
Traffic spike detected
Incoming requests increased by 300%.
Conversion rate drop
Checkout completion rate decreased significantly.
Usage pattern deviation
User behavior differs from established patterns.
System health anomaly
Multiple minor issues detected across services.
Props
AnomalyCard component API reference
| Prop | Type | Default | Description |
|---|---|---|---|
severity | 'low' | 'medium' | 'high' | 'critical' | 'medium' | Severity level affecting visual styling and urgency |
title* | string | — | Main heading describing the anomaly |
description* | string | — | Detailed explanation of what was detected |
anomalyType | 'deviation' | 'spike' | 'drop' | 'general' | 'general' | Type of anomaly determining the icon shown |
metrics | Record<string, string | number> | {} | Key-value pairs of metrics to display in a grid |
impact | string | — | Business impact assessment of the anomaly |
recommendation | string | — | Suggested action to resolve the issue |
timestamp | string | new Date().toISOString() | ISO date string for when the anomaly was detected |
onInvestigate | () => void | — | Callback when the Investigate button is clicked |
onAcknowledge | () => void | — | Callback when the Acknowledge button is clicked |
onDismiss | () => void | — | Callback when the dismiss (X) button is clicked |
className | string | — | Additional CSS classes |
Usage
Import and implementation example
import { AnomalyCard } from '@/blocks/monitoring/anomaly-card'
export default function Example() {
return (
<AnomalyCard
severity="critical"
title="Unusually high task volume detected"
description="You have 18 tasks due this week, 3x your typical workload."
anomalyType="spike"
metrics={{
'This Week': '18 tasks',
'Typical': '6 tasks',
'Increase': '3x normal',
'High Priority': '8 tasks',
}}
impact="High risk of burnout and missed deadlines."
recommendation="Consider rescheduling lower-priority tasks."
onInvestigate={() => console.log('Investigating')}
onAcknowledge={() => console.log('Acknowledged')}
onDismiss={() => console.log('Dismissed')}
/>
)
}Built With
3 componentsThis block uses the following UI components from the design system:
Features
Built-in functionality
- Severity indicators: Color-coded borders and badges for critical, high, medium, and low levels
- Anomaly type icons: Context-specific icons for spikes, drops, deviations, and general anomalies
- Key metrics display: Responsive grid layout for important numerical data
- Impact assessment: Clear explanation of business impact with highlighted styling
- Recommendations: Actionable next steps for resolution
- Technical details: Expandable section with JSON metrics and detection information
- Quick actions: Investigate, acknowledge, and dismiss buttons
- Critical animation: Pulsing top indicator for critical severity alerts
- Dark mode: Full dark mode support with proper color contrast
Accessibility
ARIA support and keyboard navigation
ARIA Attributes
role="article" on containeraria-labelledby for title associationaria-describedby for descriptionaria-live="polite" for dynamic contentKeyboard Navigation
| Key | Action |
|---|---|
| Tab | Navigate between buttons and expandable section |
| Enter / Space | Activate buttons or toggle technical details |
| Escape | Close expanded technical details |
Notes
- Severity levels use semantic color coding for visual indication
- Critical alerts have pulsing animation that can be disabled via prefers-reduced-motion
- All interactive elements have visible focus states
- Icons are decorative and hidden from screen readers