Anomaly Feed
1 variantAn alerts feed that flags metrics drifting from forecast, with band charts, snooze and resolve, and an investigate dialog.
Anomaly alerts
Metrics that drift from forecast, each with a mini band chart that draws in and pulses where the line leaves the band. Snooze and resolve with undo, open an investigate dialog with a larger chart and likely causes, and watch new anomalies arrive at the top.
Anomalies3
- CriticalSignupsUSMobile12m ago
- WarningCheckout latencyEUWeb38m ago
- InfoOrganic sessionsSearchBlog2h ago
3 open · 1 critical · last checked 1m ago
"use client";
import { AnomalyFeed } from "@/components/premium/anomaly-feed";
export function AnomalyFeedAlertsPreview() {
return (
<div className="w-full px-4 py-10">
<AnomalyFeed />
</div>
);
}
Source code is locked
Get access to install premium components and view the full source.
Open dashboardInstall
API Reference
Every prop is optional unless marked required. Data, copy, and colors default to the sample content.
AnomalyFeed21 props
anomaliesAnomalies to start with, newest first. Pass a stable (memoized) array.
Anomaly[]liveAnomalyAnomaly that arrives at the top during the live demo.
AnomalyliveRun the live demo: one new anomaly arrives a few seconds after the card is visible.
booleanDefault
trueliveDelayMsWait before the live anomaly arrives, in ms.
numberDefault
4000statusSelected tab (controlled).
"open" | "snoozed" | "resolved"defaultStatusSelected tab when uncontrolled.
"open" | "snoozed" | "resolved"Default
openonStatusChangeCalled when a tab is chosen.
((status: AnomalyStatus) => void)snoozeOptionsSnooze lengths offered in the row menu.
AnomalySnooze[]Default
["1h", "1d", "1w"]severityStylesColors for each severity; any left out keeps its default.
Partial<Record<AnomalySeverity, AnomalySeverityStyle>>lastCheckedMinutesMinutes since the last check, shown in the footer until a new anomaly arrives.
numberDefault
1undoMsHow long the undo chip stays after an action, in ms.
numberDefault
4000formatAgeFormats minutes since detection, such as "12m ago".
((minutes: number) => string)formatValueFormats chart values with the anomaly's unit.
((value: number, anomaly: Anomaly) => string)formatPercentFormats a signed deviation, given as a share of expected.
((share: number) => string)formatFooterBuilds the footer line from the open and critical counts.
((info: AnomalyFooterInfo) => string)onSnoozeCalled when an anomaly is snoozed, with the chosen length.
((anomaly: Anomaly, duration: AnomalySnooze) => void)onResolveCalled when an anomaly is resolved from its row or the dialog.
((anomaly: Anomaly) => void)onReopenCalled when a snoozed or resolved anomaly is reopened.
((anomaly: Anomaly) => void)onInvestigateCalled when the investigate dialog opens for an anomaly.
((anomaly: Anomaly) => void)labelsCopy overrides; anything left out uses the English defaults.
Partial<AnomalyFeedLabels>classNameClasses for the card.
string
AnomalyCauses4 props
causesRequiredCauses to list, most likely first.
AnomalyCause[]headingRequiredHeading over the list.
stringemptyRequiredLine shown when there are no causes.
stringreduceRequiredSkip movement, keep fades.
boolean
AnomalyEmptyIllustration3 props
statusRequiredTab the empty state belongs to, which picks the badge glyph.
"open" | "snoozed" | "resolved"accentClassNameAccent class for the badge, such as `text-emerald-500`.
stringDefault
text-emerald-500classNameExtra classes for the svg.
string
AnomalyList12 props
itemsRequiredAnomalies in the selected tab, newest first.
Anomaly[]statusRequiredSelected tab, which picks the empty state.
"open" | "snoozed" | "resolved"severityStylesRequiredColors for each severity.
Record<AnomalySeverity, AnomalySeverityStyle>reduceRequiredSkip movement, keep fades.
booleancanHoverRequiredHover-capable pointer: actions reveal on hover.
booleansnoozeOptionsRequiredSnooze lengths offered in the menu.
AnomalySnooze[]labelsRequiredCopy for rows and empty states.
AnomalyFeedLabelsformatAgeRequiredFormats minutes since detection.
(minutes: number) => stringonSnoozeRequiredCalled with an anomaly and the chosen snooze length.
(anomaly: Anomaly, duration: AnomalySnooze) => voidonResolveRequiredCalled when an anomaly is resolved.
(anomaly: Anomaly) => voidonReopenRequiredCalled when a snoozed or resolved anomaly is reopened.
(anomaly: Anomaly) => voidonInvestigateRequiredCalled when an anomaly is opened for investigation.
(anomaly: Anomaly) => void
AnomalyMiniChart6 props
anomalyRequiredAnomaly whose buckets to draw.
AnomalystyleRequiredColors for the anomaly's severity.
AnomalySeverityStylepulseRequiredPulse the anomaly marker while visible.
booleandelayRequiredSeconds before the actual line starts drawing.
numberlabelRequiredAccessible summary of the chart.
stringclassNameClasses for the chart box.
string
AnomalyRow13 props
anomalyRequiredThe anomaly to draw.
AnomalystyleRequiredColors for the anomaly's severity.
AnomalySeverityStyledelayRequiredEntrance delay in seconds; 0 for rows that join after the list opens.
numberreduceRequiredSkip movement, keep fades.
booleancanHoverRequiredHover-capable pointer: actions reveal on hover; otherwise they always show.
booleansnoozeOptionsRequiredSnooze lengths offered in the menu.
AnomalySnooze[]labelsRequiredCopy for actions and the severity name.
AnomalyFeedLabelsformatAgeRequiredFormats minutes since detection.
(minutes: number) => stringonSnoozeRequiredCalled with the chosen snooze length.
(duration: AnomalySnooze) => voidonResolveRequiredCalled when Resolve is pressed.
() => voidonReopenRequiredCalled when Reopen is pressed.
() => voidonInvestigateRequiredCalled when the row or Investigate is pressed.
() => voidrefThe row element, so AnimatePresence can pop exiting rows out of the flow.
Ref<HTMLLIElement>
FeedHeader5 props
statusRequiredSelected tab.
"open" | "snoozed" | "resolved"statusesRequiredTabs offered, in display order.
AnomalyStatus[]countsRequiredAnomalies in each tab.
Record<AnomalyStatus, number>onStatusChangeRequiredCalled when a tab is chosen.
(status: AnomalyStatus) => voidlabelsRequiredCopy for the title and tabs.
AnomalyFeedLabels
RollingCount2 props
valueRequiredCount to show; rolls up when it grows and down when it shrinks.
numberclassNameClasses for the number.
string
InvestigateDialog10 props
anomalyRequiredAnomaly to show; keep the last one set while the dialog closes.
Anomaly | nullopenRequiredWhether the dialog is open.
booleanonOpenChangeRequiredCalled with false when the dialog asks to close.
(open: boolean) => voidonExitCompleteRuns after the closing animation completes.
(() => void)styleRequiredColors for the anomaly's severity.
AnomalySeverityStyle | nulllabelsRequiredCopy for the dialog.
AnomalyFeedLabelsformatValueRequiredFormats chart values with the anomaly's unit.
(value: number, anomaly: Anomaly) => stringformatPercentRequiredFormats the signed deviation, given as a share of expected.
(share: number) => stringformatAgeRequiredFormats minutes since detection.
(minutes: number) => stringonResolveRequiredCalled once Mark resolved finishes; the dialog then closes.
(anomaly: Anomaly) => void
RowActions10 props
statusRequiredStatus of the row, which picks its actions.
"open" | "snoozed" | "resolved"metricRequiredMetric name, used in accessible names.
stringiconOnlyRequiredIcon-only buttons with tooltips (hover layout), or labelled buttons (touch).
booleansnoozeOptionsRequiredSnooze lengths offered, in display order.
AnomalySnooze[]labelsRequiredCopy for every action.
AnomalyFeedLabelsonSnoozeRequiredCalled with the chosen snooze length.
(duration: AnomalySnooze) => voidonResolveRequiredCalled when Resolve is pressed.
() => voidonReopenRequiredCalled when Reopen is pressed on a snoozed or resolved row.
() => voidonInvestigateRequiredCalled when Investigate is pressed.
() => voidonMenuChangeRequiredCalled when the snooze menu opens or closes, so the row stays revealed.
(open: boolean) => void
SegmentChips2 props
segmentsRequiredSegment names, such as `["US", "Mobile"]`.
string[]classNameExtra classes for the list.
string
SeverityBadge5 props
severityRequiredSeverity to show.
"info" | "warning" | "critical"styleRequiredColors for the severity.
AnomalySeverityStylelabelsRequiredCopy for the severity names.
AnomalyFeedLabelsvariant`dot` for rows (name read by screen readers only), `pill` for the dialog.
"dot" | "pill"Default
dotclassNameExtra classes.
string
UndoChip4 props
noticeRequiredThe last snooze or resolve, or null when there is nothing to undo.
AnomalyNotice | nulllabelsRequiredCopy for the notice and the undo action.
AnomalyFeedLabelsreduceRequiredSkip movement, keep fades.
booleanonUndoRequiredCalled when Undo is pressed.
() => void
useAnomalyFeed7 props
anomaliesRequiredAnomalies to start with.
Anomaly[]liveAnomalyAnomaly that arrives during the live demo.
AnomalyliveRequiredRun the live demo.
booleanactiveRequiredOnly count down to the live arrival while true (the card is on screen).
booleanliveDelayMsRequiredWait before the live anomaly arrives, in ms.
numberlastCheckedMinutesRequiredMinutes since the last check, shown in the footer at first.
numbernoticeMsRequiredHow long the undo chip stays, in ms.
number
Types6 types
The object types these props take, field by field.
Anomaly11 fields
idRequiredStable id, used as the row key so rows glide between states.
stringmetricRequiredMetric name, such as "Signups".
stringsummaryRequiredOne plain sentence, such as "Signups 32% below forecast".
stringseverityRequiredUrgency, which picks the dot, pill and line colors.
AnomalySeveritystatusRequiredTab the anomaly starts in.
AnomalyStatussegmentsRequiredSegment chips, such as `["US", "Mobile"]`.
string[]detectedMinutesAgoRequiredMinutes since the anomaly was detected; whole numbers keep server and client output equal.
numberpointsRequiredBuckets for the chart: band, expected and actual values.
ForecastPoint[]unitUnit appended to values, such as `ms` or `%`.
stringcausesLikely causes listed in the investigate dialog.
AnomalyCause[]snoozedForSnooze length, set when the anomaly is snoozed.
AnomalySnooze
AnomalySeverityStyle3 fields
dotRequiredDot fill class, such as `bg-rose-500`. Also used by the chart marker.
stringpillRequiredTinted pill classes for the severity label.
stringstrokeRequiredStroke class for the line where it leaves the band.
string
AnomalyFooterInfo3 fields
openRequiredAnomalies in the Open tab.
numbercriticalRequiredOpen anomalies marked critical.
numbercheckedMinutesAgoRequiredMinutes since the last check.
number
AnomalyFeedLabels33 fields
titleRequiredCard heading.
stringtabsRequiredAccessible name for the status tabs.
stringopenRequiredTab label for open anomalies.
stringsnoozedRequiredTab label for snoozed anomalies.
stringresolvedRequiredTab label for resolved anomalies.
stringcriticalRequiredSeverity label for critical anomalies.
stringwarningRequiredSeverity label for warnings.
stringinfoRequiredSeverity label for informational anomalies.
stringsnoozeRequiredSnooze menu trigger.
stringsnooze1hRequiredSnooze option for one hour.
stringsnooze1dRequiredSnooze option for one day.
stringsnooze1wRequiredSnooze option for one week.
stringresolveRequiredResolve action.
stringinvestigateRequiredInvestigate action.
stringreopenRequiredReopen action for snoozed and resolved rows.
stringundoRequiredUndo action in the confirmation chip.
stringsnoozedNoticeRequiredConfirmation after a snooze.
stringresolvedNoticeRequiredConfirmation after a resolve.
stringreopenedNoticeRequiredConfirmation after a reopen.
stringemptyOpenRequiredEmpty state heading for the Open tab.
stringemptySnoozedRequiredEmpty state heading for the Snoozed tab.
stringemptyResolvedRequiredEmpty state heading for the Resolved tab.
stringemptyHintRequiredEmpty state line under each heading.
stringdeviationRequiredDialog stat: deviation from forecast.
stringactualRequiredDialog stat: measured value.
stringexpectedRequiredDialog stat: forecast value.
stringdetectedRequiredDialog stat: detection time.
stringcausesRequiredDialog heading over the causes list.
stringnoCausesRequiredDialog line when no causes are known.
stringcloseRequiredDialog close button.
stringmarkResolvedRequiredDialog resolve button.
stringresolvingRequiredDialog resolve button while saving.
stringresolvedDoneRequiredDialog resolve button once done.
string
AnomalyCause4 fields
idRequiredStable id, used as the list key.
stringlabelRequiredOne plain sentence, such as "Release v2.4 deployed 14m earlier".
stringdetailShort context on the right, such as a time or a source.
stringkindIcon shown in the cause's chip.
"release" | "campaign" | "incident" | "traffic"
AnomalyNotice5 fields
keyRequiredChanges on every action so the chip restarts its timer.
numberidRequiredAnomaly that moved.
stringstatusRequiredWhere it moved to.
AnomalyStatuspreviousRequiredWhere it came from, restored by undo.
AnomalyStatuspreviousSnoozeSnooze length it had before, restored by undo.
AnomalySnooze