Alert
A persistent message about the surface you are on, not about what you just did.
Default
Title plus description. The leading icon is chosen from the variant.
pnpm generate to rebuild the palette from the source of truth.Usage
import {
Alert,
AlertAction,
AlertDescription,
AlertTitle,
} from '@oceanic-hub/brand-system'<Alert>
<AlertTitle>…</AlertTitle>
<AlertDescription>…</AlertDescription>
</Alert>Composition
Use the following composition to build an Alert:
Alert
├── AlertTitle
├── AlertDescription
└── AlertActionUse an Alert for a condition that stays true while the page is open — a stale
export, a read-only environment. For the result of an action a person just took, use a
toast (Toaster); for something that must be answered before anything else happens, use
a Dialog.
destructive carries a real red now — @OCE-1746 adopted a palette that has one, so it no
longer shares a hue with info. What has not changed is the rule that outranks it: if the
alert only reads as serious because it is coloured, the sentence is too weak — rewrite the
sentence. The colour agrees with the copy; it never replaces it.
The tone is the tint. The icon only splits destructive off — the other three share Info —
so the tint and the sentence are what a reader has to tell four states apart. The words are ink
(@OCE-1747) — text-stuck as body text measured 4.03:1, below AA.
Upstream's "Custom Colors" example overrides an alert with arbitrary Tailwind fills
(bg-amber-50 and friends). Nothing stops it mechanically — the palette is emitted and
cn() will let it win — which is exactly why it is refused by doctrine rather than by a gate:
core-layer.md forbids a colour outside tokens.source.mjs, and an ad hoc tone would
undercut the ones that already carry the states this component is for. Reach for a variant; if
none fits, that is a token-layer conversation, not a className override.
RTL is not supported — recorded in pairings.json under direction: nothing in this
package has been laid out or measured right-to-left.
Destructive
For a condition serious enough to interrupt, but not so absolute it needs a confirmation dialog. The sentence carries the severity — destructive supplies a matching stuck fill, never the other way around.
Info
Upstream ships two variants; this is one of the two Oceanic added (@OCE-1746) so a page can carry a neutral heads-up without borrowing destructive's weight or default's silence.
Success
The other Oceanic addition: a condition that stays true and is good news — a publish that completed, a sync that is caught up — which default's neutral fill cannot say on its own.
Without the icon
hideIcon for a dense surface where the icon column is already spoken for.
With an action
The action sits beside the copy, not under it. Place it anywhere in the children.
API Reference
See the Alert API page for every prop of every part, with types, defaults and the contract that pins them. It also documents alertVariants — exported alongside the parts, and signatures rather than props.