Skip to content
HomeCobalt

Banner

Says one thing about the whole app that came while the person was reading, such as being offline or a new version being ready, in a line that floats at the foot of the window and moves nothing on the page.

Examples

Offline, the list stays and a line floats at the foot of the window; Try again asks the server before reading again, so a press while still offline changes nothing. Turn on the Offline control above, then press Refresh.

Latest filings

  • Harbour Large Cap Core
    Form N-PORT
    2 hours ago
  • Calder Global Equity
    Form N-PORT
    Yesterday
  • Northgate Short Duration
    Form N-PORT
    3 days ago
NewsNews that can wait floats at the foot of the window with its one action and a close button; nothing on the page moves for it.

Usage

Use it when

  • The app lost its connection while the person reads, and what is on screen stays useful.
  • News about the app that can wait: a new version is ready, maintenance starts in 10 minutes.

Use something else when

  • Something known when the page renders, such as a read-only workspace or a plan limit. Use Alert instead, in the page.
  • The page has nothing to show because it could not load. Use PageProblem instead.
  • Something finished that the person started. Use Toaster instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/banner.json https://kaanarici.com/r/cobalt/use-online.json
import { Banner, OfflineBanner } from "@/components/cobalt/ui/banner"
import { useOnline, checkOnline, reportOffline } from "@/lib/cobalt/use-online"