Components Feedback
Alert
StableAn inline message about the state of a page or section, in four tones.
Alert sits in the content flow, near what it describes, and stays until the situation changes or the user dismisses it. Use it for form-level errors, expiring connections or plan limits. For page-wide announcements use Banner; for transient confirmations use Toast.
Overview
Signatures update overnight
import { Alert } from '@bindshq/stance-react';
export function Basic() {
return (
<Alert title="Signatures update overnight">
Changes you publish today reach every mailbox after the 02:00 sync.
</Alert>
);
}Light, dark and high contrast
Every Stance component is designed and tested in all three appearance modes.
Signatures update overnight
Signatures update overnight
Signatures update overnight
Import
import { Alert } from '@bindshq/stance-react';Platforms
Alert has native counterparts. They share Stance tokens and intent, and use each platform’s own controls and conventions. The live previews on this page are the web implementation.
import { Alert } from '@bindshq/stance-react';Examples
Directory sync is on
Exchange connected
48 of 50 seats used
Deployment failed
import { Alert } from '@bindshq/stance-react';
export function Tones() {
return (
<div style={{ display: 'grid', gap: 12 }}>
<Alert tone="info" title="Directory sync is on">
New starters receive the default signature automatically.
</Alert>
<Alert tone="success" title="Exchange connected">
Signatures will deploy through your relay.
</Alert>
<Alert tone="warning" title="48 of 50 seats used">
Add seats before inviting more people.
</Alert>
<Alert tone="danger" title="Deployment failed">
Exchange rejected the connection. Check your relay credentials.
</Alert>
</div>
);
}Azure connection expires in 3 days
import { Alert, Button } from '@bindshq/stance-react';
export function WithActions() {
return (
<Alert
tone="warning"
title="Azure connection expires in 3 days"
actions={
<>
<Button size="sm">Reconnect</Button>
<Button size="sm" variant="ghost">
Remind me later
</Button>
</>
}
>
Signatures stop deploying when the token expires.
</Alert>
);
}Import complete
import * as React from 'react';
import { Alert, Button } from '@bindshq/stance-react';
export function Dismissible() {
const [open, setOpen] = React.useState(true);
return open ? (
<Alert tone="success" title="Import complete" onDismiss={() => setOpen(false)}>
120 users were added to your organisation.
</Alert>
) : (
<Button variant="outline" size="sm" onClick={() => setOpen(true)}>
Show again
</Button>
);
}API reference
| Prop | Type | Default | Description |
|---|---|---|---|
tone | 'info' | 'success' | 'warning' | 'danger' | 'info' | Meaning of the message. |
title | ReactNode | None | Short heading. |
children | ReactNode | None | Description. |
icon | ReactNode | false | None | Replace the tone icon or hide it. |
actions | ReactNode | None | Buttons or links under the message. |
onDismiss | () => void | None | Shows a dismiss button. |
dismissLabel | string | 'Dismiss' | Dismiss button label. |
role | AriaRole | None | Override the automatic role (alert for warning/danger, status otherwise). |
Accessibility
- Warning and danger alerts use role="alert" and are announced immediately; info and success use role="status".
- Tone is conveyed by icon and title text, never colour alone.
- Status colours meet 4.5:1 contrast in all three themes; high contrast adds heavier borders.
Usage guidelines
Do
- Say what happened and what to do next.
- Place the alert next to the content it concerns.
Don’t
- Render role="alert" messages on page load for non-urgent information.
- Stack several alerts; combine them.