Skip to content
HomeCobalt

Alert

Tells the person something about the page they are on before they go on: a limit they reached, data that is behind, a load that failed and how to retry it.

Examples

A notice with a title and a line on what it means.
Filings for October are still arriving
Funds have until Nov 14 to file, so totals for the month will change.
In a cardA warning at the top of a card, above the facts it is about.
Calder Global Equity
Calder & Rowe, last filed Jun 30.
Filing is 17 days late
The figures below are from the June filing.

Net assets $1.2B across 412 holdings.

Variants

48 of 50 saved searches used
Delete a search you no longer run to save a new one.
WarningA limit the person is close to, or data that may be stale.
The June filing could not be read
Its holdings are left out of the totals until Harbour Capital files it again.
DestructiveSomething went wrong, such as a load or a payment that failed.

States

  • Northgate Treasury 2031
  • Calder Global Equity
  • Harbour Short Duration
With actionA load that failed, with Retry on the alert; when it works the holdings take its place.

Usage

Use it when

  • A load or an action failed in a place the person is looking at, and they can retry it there.
  • The page's data is incomplete, late or limited, and the person should know before they read it.
  • The person is close to a limit, such as saved searches or seats.

Use something else when

  • The message is the result of an action whose place the person has left. Use Toaster instead.
  • The list or page has nothing to show at all. Use Empty instead.
  • The message is about one field. Use Field instead, with its error.
  • The action cannot be undone and needs a yes. Use AlertDialog instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/alert.json
import { Alert, AlertContent, AlertTitle, AlertDescription, AlertAction } from "@/components/cobalt/ui/alert"