Ballmac UI home

Alerts 1: alert rules

The alert rules of a monitoring setup: what each watches, severity, where it notifies, and firing, muted or fine in words, firing first, switch off, mute for an hour, four hours or a day, send a test, all undone with the reason if it fails.

State

The normal view. Pick a state to see what the block shows while it loads, is empty or fails.

Open in v0 (opens in a new tab)

Installation

$ pnpm dlx shadcn@latest add @ballmac/alerts-1

Usage

Example: alerts-1-demo.tsx
"use client"

import { Alerts1 } from "@/components/ballmac/blocks/alerts-1/alerts-1"

export default function Alerts1Demo() {
  return <Alerts1 onToggle={() => new Promise((r) => setTimeout(r, 300))} onMute={() => new Promise((r) => setTimeout(r, 300))} onTest={() => new Promise((r) => setTimeout(r, 400))} />
}

States

Pass state and the block does the rest: skeletons that match its layout, a clear empty message, an error you can retry, and announcements for screen readers.

  • Loading

    Skeleton rows under the real heading, announced as loading.

    state="loading"
  • No alert rules yet

    Says no alert rules yet; emptyState sets the copy. A filter with no match says so.

    state="empty"
  • Could not load

    An alert saying nothing was changed or muted, with Try again (onRetry). A change that fails goes back and says why.

    state="error"

Dependencies

Use with AI

Alert rules. <Alerts1 rules={[{ id, name, condition, severity: 'critical' | 'warning' | 'info', channel, status: 'firing' | 'ok' | 'muted', enabled, since?, until? }]} onToggle={(rule, enabled) => Promise} onMute={(rule, hours) => Promise /* hours 0 means unmute */} onTest={(rule) => Promise} />. Firing rules are listed first. Each action updates the screen at once and is undone if the handler rejects. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Alerts 1: alert rules (@ballmac/alerts-1) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • The settings page of a monitoring or alerting tool
  • An on-call overview of what is firing and what is muted

Not for

  • Notification preferences for end users; use settings-1
  • A feed of past alerts; use audit-1 or log-stream

Registry JSON: https://ui.ballmac.com/r/alerts-1.json

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.