Arc
ComponentsBlocksDocsPricingTry the demo
Get Pro
Introduction
Installation
Theming
Motion
AI and MCP
Changelog
Metrics dashboardPro
KPI drilldownPro
Metric explorerPro
Revenue explorerPro
MRR waterfallPro
Cohort retentionPro
Usage forecastPro
Journey flowPro
Uptime statusNewPro
Choropleth explorerPro
Connected scatterPro
Horizon chartPro
Account healthNewPro
Market terminalPro
Budget variancePro
Small multiplesPro
Line replayPro
AI chatPro
AI composerPro
AI answerPro
Model pickerPro
Model arenaPro
Prompt studioPro
Document extractionPro
Agent memoryPro
AI side panelPro
Research runPro
AI insight cardNewPro
Catch upNewPro
AI feature launchNewPro
AI search barNewPro
AI setup wizardNewPro
Call insightsNewPro
Lead scoringNewPro
Agent runPro
Agent tasksPro
Agent approvalsPro
Agent routinesPro
Agent orchestratorPro
MCP serversPro
Knowledge basePro
Eval suitePro
Agent builderNewPro
Agent galleryNewPro
SidebarPro4
Page header
Command palette
Notification center
Selection toolbarPro
Empty states
Search resultsPro
Login and sign up5, free and Pro variants
Onboarding illustrationPro
OTP input
Multi-step formPro
Two-factor setupNewPro
Magic linkNewPro
Settings pagePro
Settings commandPro
Security settingsPro
Billing overviewPro
Usage billingPro
Cancel flowPro
Onboarding surveyNewPro
Spend alertNewPro
Team membersPro
Invite peoplePro
Team directoryPro
Roles and permissionsPro
Profile pageNewPro
API keysPro
WebhooksPro
IntegrationsPro
Environment variablesPro
Domain verifyNewPro
Webhook testerNewPro
Plan comparison
Pricing calculatorPro
Usage pricingPro
Cart drawerPro
Checkout summaryPro
Live checkoutPro
Seat managerNewPro
Credit top-upNewPro
Invoice studioPro
Wallet cardPro
Delivery trackerPro
Product listingPro
Product detailPro
Activity feedNewPro
Inbox triagePro
Support conversationPro
Support widgetPro
Help centerPro
Feature votingNewPro
File upload
Media playerPro
Week calendarPro
Availability pickerPro
Project boardPro
Release readinessPro
Kanban boardPro
Smart schedulerNewPro
Task breakdownNewPro
Goal trackerNewPro
Hero section
Hero signupPro
Scroll storyPro
Spotlight gridPro
Feature bentoPro
Comparison table
Logo marquee
Studio perspectivesPro
Stats band
Changelog feed
FAQ section
Contact section
Team showcasePro
Blog grid
Site header
Site footer
CTA section
Newsletter signup
Activity terrainPro
Revenue globePro
Customer galaxyPro
Semantic zoomPro
Layout morphPro
Exploded viewPro
What’s new74 new
BlocksSpend alert

Spend alert

Pro

A budget and spend alert card where the threshold is set right on the live spend bar, with forecast, Email, Slack and PagerDuty toggles, a hard stop and a live preview of the Slack message the alert will post.

Live block · sample data

When to use

  • Letting a team set a monthly budget and alert threshold for metered spend.
  • Showing how close current and forecast spend are to an alert line.
  • Choosing where cost alerts go and previewing the Slack message before saving.

When not to use

  • Read-only usage reporting with no settings; use usage-forecast or usage-billing instead.
  • Per-seat plans with no metered spend.
  • Complex multi-budget policies across many projects; use a table of budgets that opens this card per row.

Installation

Pro source and install commands unlock with a Pro plan.

Usage

Drop SpendAlert into a billing or usage settings page. Pass `spend` and `period` from your usage API (the forecast is projected for you unless you pass `forecast`), set the starting `defaultValue` (budget, threshold, channels, hardStop), and set `destinations` for your email, Slack channel and PagerDuty service. Wire `onSave` and `onSendTest`: each receives the settings and an AbortSignal, and the card handles the loading, saved, error and unsaved-changes states. Without handlers, both actions are simulated and the live region says so. `onChange` reports every edit.

example.tsx
1import { SpendAlert } from "@/components/arc/blocks/spend-alert/spend-alert";2 3export function BillingAlerts({ usage }: { usage: { spend: number } }) {4  return (5    <SpendAlert6      project="Production"7      spend={usage.spend}8      defaultValue={{ budget: 5000, threshold: 80 }}9      destinations={{ email: "finance@acme.com", slack: "#eng-spend" }}10      onSave={async (settings, signal) => {11        const response = await fetch("/api/budget-alerts", { method: "PUT", body: JSON.stringify(settings), signal });12        if (!response.ok) throw new Error("Save failed");13      }}14    />15  );16}
Built fromSwitchButton

API reference

SpendAlert

Budget and spend alert settings in one card: a monthly budget, a threshold slider drawn on the live spend bar, Email, Slack and PagerDuty toggles, a hard stop switch, and a live preview of the Slack message the alert posts. Renders the full demo with no props.

PropTypeDefaultDescription
titlestring"Spend alerts"Card title.
projectstring"Production"Project or workspace the budget applies to. Used in the subtitle and the Slack message.
scopestring"Model API usage"What is being metered, shown in the subtitle.
spendnumber3412.8Spend so far this period, drawn as the solid fill on the bar.
forecastnumber–Projected spend at period end, drawn as the lighter fill. Defaults to a linear projection from spend and period.
period{ label: string; short: string; day: number; days: number; resetsOn: string }{ label: "October", short: "Oct", day: 27, days: 31, resetsOn: "Nov 1" }Billing period used for the forecast, the crossing date and the reset copy.
currencystring"USD"ISO 4217 currency code for formatting.
defaultValuePartial<SpendAlertSettings>{ budget: 5000, threshold: 80, channels: { email: true, slack: true, pagerduty: false }, hardStop: false }Initial settings. Missing fields fall back to the demo defaults.
markersnumber[][50, 80, 100]Threshold markers on the bar. The thumb snaps to them within 2% while dragging, and PageUp or PageDown jumps between them.
destinationsPartial<Record<"email" | "slack" | "pagerduty", string>>{ email: "finance@acme.com", slack: "#eng-spend", pagerduty: "Platform on-call" }Where each channel delivers. PagerDuty pages only at 100%.
appNamestring"Acme Billing"Sender name in the Slack preview.
lastSavedstring"Last edited Oct 24 by Maya Chen"Footer copy while nothing has changed.
onChange(settings: SpendAlertSettings) => void–Called on every edit.
onSave(settings: SpendAlertSettings, signal: AbortSignal) => Promise<void>–Persist the settings. Without it the save is simulated. Reject to show the error state.
onSendTest(settings: SpendAlertSettings, signal: AbortSignal) => Promise<void>–Send a test alert to the enabled channels. Without it the send is simulated.
classNamestring–Extra class on the card.

Keyboard interactions

Arrow keys
On the threshold slider, move the alert line by 1%.
Shift+Arrow keys
Move the alert line by 10%.
PageUporPageDown
Jump to the next or previous marker.
HomeorEnd
Set the threshold to 10% or 100%.
ArrowUporArrowDown
In the budget field, change the budget by 100 (Shift for 1,000).
Space
Toggle a focused channel or the hard stop switch.

Accessibility

  • The threshold is a role="slider" labelled "Alert at" with aria-valuetext giving the percent and the amount.
  • The budget field is labelled and described by its helper line, which also carries the invalid and over-budget messages with aria-invalid.
  • Each channel switch has its own label; the hard stop switch is labelled by its row title.
  • Save and test results land in a polite live region, including "Simulated, nothing was sent" when no handler is wired.
  • Status is never color alone: every tone pairs an icon with a short label.

Motion

  • Spend and forecast fills grow in once when the card scrolls into view (720ms ease-out), then follow budget changes in 160ms.
  • The thumb follows the pointer 1:1 while dragging and glides 160ms on clicks, marker jumps and keys.
  • Status, helper and footer lines swap with a single crossfade in one grid cell, so nothing changes size.
  • Switching Slack off crossfades the preview to a placeholder inside the same box. A test send washes the preview once.
  • Reduced motion keeps every end state and drops the fill growth and glides.

Responsive behavior

  • Holds from 360px to 580px. Under 440px the gutter tightens, channel destinations move under their names and the footer actions go full width.
  • Every line truncates with an ellipsis rather than wrapping, so state changes never change the card height.
  • The slider rail is 28px tall for touch and keeps vertical page scroll (touch-action: pan-y).

Performance

  • Bar fills animate clip-path and the thumb animates left on one element; no layout animation on text.
  • One IntersectionObserver runs until the first reveal, then disconnects.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Use for usage-based billing settings: AI model spend, cloud cost budgets, API overage alerts.
  • Pass spend and period from your usage API; forecast is derived unless you pass your own.
  • Wire onSave and onSendTest with the AbortSignal; the card handles loading, success, error and dirty states.
  • Keep it as one card in a settings page; do not wrap it in another card.
/components/blocks/spend-alert/markdown

The full library index for assistants is at /llms.txt.

Related

Usage forecastProBlockA billing period usage chart with a forecast cone and a draggable budget that dates the crossing.Usage billingProBlockA usage based billing dashboard with a projected spend line, meters against limits, alerts, and an upgrade that morphs into a confirm sheet.Billing overviewProBlockA billing page where the plan card morphs into a picker and usage, invoices, and card follow.SwitchComponentA tactile toggle for settings that take effect immediately.SliderComponentPick a value or a range on a track that follows your finger.
PreviousGoal tracker
Arc · 129 block pagesllms.txt

On this page

  • Preview
  • When to use
  • When not to use
  • Installation
  • Usage
  • API reference
  • Keyboard
  • Accessibility
  • Motion
  • Responsive behavior
  • Performance
  • Notes for AI
  • Related
View as Markdown

Spend alerts

Production · Model API usage in October

On track
Resets Nov 1, in 5 days
$USD
Alert at80%·$4,000
Spent $3,412.80Forecast $3,918 by Oct 3168% used
Notify
  • Emailfinance@acme.com
  • Slack#eng-spend
  • PagerDutyPlatform on-call at 100%
Hard stop at 100%Keep serving past the budget
Slack preview#eng-spend
A
Acme BillingApp9:41 AM

Production passed 80% of budget

Used$4,000 of $5,000Forecast$3,918 by Oct 31

Also emailed finance@acme.com

Turn on Slack to preview this alert
Last edited Oct 24 by Maya Chen