System Alert

SystemAlert displays a dismissible page-level status message.

Your workspace is back online
tsx
import { SystemAlert } from '@/components/ui/wideset/system-alert/SystemAlert';

<SystemAlert message="Your workspace is back online">
  <SystemAlert.Action>View status</SystemAlert.Action>
</SystemAlert>

Installation

pnpm dlx wideset add system-alert

Copies the component and any Wideset components it uses into your project.

Examples

Statuses

A system alert speaks for the whole product, so it sits at the top of the page, above everything else. negative gets role="alert" and is read out at once; every other status is role="status", read when the screen reader is idle. Only neutral has no icon.

tsx
import { SystemAlert } from '@/components/ui/wideset/system-alert/SystemAlert';

export default function SystemAlertStatuses() {
  return (
    <div className="gap-ws-5 flex w-[30rem] max-w-full flex-col">
      <SystemAlert status="positive" message="Your workspace is back online" />
      <SystemAlert status="negative" message="Payment failed for your plan" />
      <SystemAlert status="notice" message="Scheduled maintenance tonight at 22:00" />
      <SystemAlert status="info" message="A new version is ready to install" />
      <SystemAlert status="neutral" message="You are viewing a shared copy" />
    </div>
  );
}

Emphasis

low is the default for news the user can read later. high is for a problem that blocks work, such as a failed payment; keep it rare, or every banner looks urgent. Actions and the dismiss button switch to the inverse style on a high alert by themselves, except on notice.

tsx
import { SystemAlert } from '@/components/ui/wideset/system-alert/SystemAlert';

export default function SystemAlertEmphasis() {
  return (
    <div className="gap-ws-5 flex w-[30rem] max-w-full flex-col">
      <SystemAlert status="negative" emphasis="low" message="Payment failed for your plan">
        <SystemAlert.Action>Update card</SystemAlert.Action>
      </SystemAlert>
      <SystemAlert status="negative" emphasis="high" message="Payment failed for your plan">
        <SystemAlert.Action>Update card</SystemAlert.Action>
      </SystemAlert>
    </div>
  );
}

API reference

SystemAlert

NameDescriptionDefault
dismissAriaLabel

Accessible label for the dismiss button. Defaults to `'Dismiss'`.

string
'Dismiss'
dismissed

Controls whether the alert is hidden.

boolean
—
dismissible

When true, renders the dismiss button.

boolean
true
emphasis

Controls whether the alert uses subtle or inverse styling.

SystemAlertEmphasis
'low'
message

Message content when not using SystemAlert.Message.

ReactNode
—
onDismiss

Callback fired when the dismiss button is clicked.

(() => void)
—
status

The semantic status of the alert.

SystemAlertStatus
'positive'
Every other prop of <div> is passed through to it. See MDN: <div>.

SystemAlert.Action

NameDescriptionDefault
asChild

Whether to render the button styling onto its child element via Radix Slot.

boolean
—
children

Button label or custom content rendered inside the root.

ReactNode
—
className

Additional CSS classes merged with the button root.

string
—
defaultMotion

Turns the component's built-in animations on or off. When omitted, inherits the value from the nearest `MotionProvider`.

boolean
true
disabled

Disables the button visually and functionally.

boolean
—
onClick

Called when the user activates the button.

MouseEventHandler<HTMLButtonElement>
—
preset
'border''filled''ghost'
'border'
size
'xs''sm''md''lg'
'xs'
type

Native button type used for form behavior.

'button''submit''reset'
—
variant
'primary''secondary''danger''success''inverse'
—

SystemAlert.Message

NameDescriptionDefault
children*

Use SystemAlert.Message and SystemAlert.Action inside children. The message slot overrides the message prop.

ReactNode
—

Accessibility

  • negative renders role="alert" (read at once); every other status renders role="status".
  • The icon is decorative; the message carries the meaning.
  • dismissAriaLabel names the dismiss button (default 'Dismiss').
PartRendersDescription
SystemAlert<div>A dismissible page-level status message.
SystemAlert.Action—An action styled for `SystemAlert`.
SystemAlert.Message—The message displayed inside the feedback surface.
Your workspace is back online
tsx
import { SystemAlert } from '@/components/ui/wideset/system-alert/SystemAlert';

<SystemAlert message="Your workspace is back online">
  <SystemAlert.Action>View status</SystemAlert.Action>
</SystemAlert>

Appearance

Status
Emphasis

Content

Dismissible
Action