GitHubGitHub
← All widgets
Alerts / widget

Alert widget

Severity-ranked active alerts with source, age, acknowledgement, and open callbacks.

CriticalHighAcknowledgedResolvedEmpty

Active alerts

2
Resolved
Acknowledged
<AlertWidget {alerts} onacknowledge={acknowledge} />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { AlertWidget } from '@chanrg/4ui';<AlertWidget {alerts} onacknowledge={acknowledge} />

API reference

Props

PropTypeDefaultDescription
alertsAlertItem[][]Caller-owned alert records.
onacknowledge(alert) => voidNo API call is performed internally.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Severity uses text and distinct glyphs in addition to color.
  • Actions are explicit buttons.

Dependencies

Badge, EmptyState