# Alert Rules block

> Alert Rules Settings Form with Tabs and Validation

Tabbed settings form for configuring alert thresholds, delivery channels, quiet hours, and escalation with validation and save/discard. ReUI Alert, Badge; shadcn Button, Card, Tabs, Select, Switch. Analytics settings, configuration form.

- Type: Pro block
- Category: [Analytics](https://web.dev.reui.io/blocks/solutions/analytics.md)
- Page: https://web.dev.reui.io/blocks/solutions/analytics/solution-analytics-9
- MCP: `get_block("solution-analytics-9")`
- Built with: Alert, Badge, Button, Card, Field, Select, Separator, Switch, Tabs
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

A tabbed alert rule form whose empty threshold blocks save, with delivery switches, quiet hours and admin locked escalation

## Agent notes

- The `ALERT_RULES`, `DELIVERY_CHANNELS`, `QUIET_TOGGLES` and `ESCALATION_TOGGLES` exports in data.tsx are the sample rules to replace
- The `handleSave` handler only clears `dirty` and toasts a hardcoded Theo Park line, and `handleDiscard` restores the initial defaults, not the last save
- The channel buttons and Request access only call `showToast`, and the escalation switches are disabled with no state

## When not to use

- An account area for profile, password, notifications and billing: use [Account Settings](https://web.dev.reui.io/blocks/application/settings/settings-7.md) (`get_block("settings-7")`)
- Sign in policy settings such as passkeys, phone and lockout: use [Auth Method Settings](https://web.dev.reui.io/blocks/application/form/form-4.md) (`get_block("form-4")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/solution-analytics-9
```

## About Analytics blocks

### When to use

- Product usage reports: overall health, feature adoption, activation funnel, cohort retention or an A/B test
- Analyst workspaces for an event catalog, weekly segment rule coverage or the detail page of one metric
- Alert rule settings for product metrics: thresholds, delivery per rule and channel, and quiet hours

### When not to use

- A team home for operations work such as fulfillment, staffing, calls or payouts: use the [Dashboard blocks](https://web.dev.reui.io/blocks/application/dashboard.md)
- A single trend card placed inside a page you already built: use the [Line Chart blocks](https://web.dev.reui.io/blocks/chart/line-chart.md)
- A plain table of your own records with sorting and filters and no report around it: use [Data Grid](https://web.dev.reui.io/components/data-grid.md) (`get_component("data-grid")`)

### Agent notes

- Every block sets a `min-h-svh` wrapper plus its own max width and padding in page.tsx or its root; remove them inside your app shell
- Filters and edits live in `useState` and reset on reload; no block requests or persists data, so connect each to your analytics backend

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
