Skip to content

Block 267 of 297

Alerts Panel

Threshold alerts listed by severity with icons, times and action links, or an all-clear state.

Puck key
AlertsPanelBlock
Export
alertsPanelBlock
React component
<AlertsPanel />
Path
components/puck/alerts-panel-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A single dashboard card that lists threshold alerts, each with a severity badge, icon, metric name, message, time and an optional link. Count badges in the header total each severity, and an "All clear" state appears when the list is empty. Outside a Dashboard Grid it centers itself as a standalone card up to a medium width.

  • An operations dashboard that flags capacity, inventory or staffing limits
  • A program manager's view of grant deadlines and reporting thresholds
  • A status card for site health, such as donation checkout or form errors
Writing the content
  • Write the Message as the reading plus the limit, such as "98%, above the 95% limit".
  • Severity also accepts bound words like error, warn or high; anything unrecognized becomes Info.
  • A link shows only when both Link label and Link URL are filled in. Alerts with no Metric and no Message are skipped.
  • Bind up to 20 alerts to a P1 data source with tokens such as {{ alerts.items }} and {{ item.metric }}.
Accessibility
  • Severity is never shown by color alone: each alert carries a written badge (Critical, Warning, Info) and a distinct icon shape (WCAG 1.4.1).
  • Alerts render as a real list, and each link adds hidden text naming its metric, so repeated link labels stay distinct.
  • The Heading level setting runs from H2 to H4 or plain text, and links have a visible focus ring and a 44px minimum height.
Customizing the code
  • Severity colors live in the STYLE map (red, amber, indigo); edit them there to keep badges, icons and edges in sync, and extend toSeverity() for other severity words.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Titletext
  • Heading levelselect
  • Subtitletext
  • Alertsarray
  • Orderradio
  • All-clear messagetext
  • Footnotetext