Banner
DraftA full-width announcement bar for site-wide or page-level status messages.
- Usage
- Specs
- Content
- Status & changelog
- Code
Common alternative names
Notice, Announcement bar, Info bar
Anatomy
A banner is a full-width container that holds a message with optional artwork and an action. It supports both multi-line layouts with a headline and single-line layouts with paragraph text only.
(Required)
(Required)
(Optional)
text
Leading artwork
The leading position supports custom icons or badges to reinforce the banner's intent.
Base icons at size 24. Use semantic icons that match the banner variant (info, success, warning, danger).
Asset library badges at size 40. Used when a stronger visual emphasis is needed beyond a simple icon.
Usage guidelines coming soon.
Specs coming soon.
Content guidelines coming soon.
Status & changelog coming soon.
Usage
import { Banner } from '@arch-ui/components';
<Banner variant="info">
New feature available -- check out the updated dashboard.
</Banner>
Variants
<Banner variant="info">Informational message.</Banner>
<Banner variant="success">Operation completed successfully.</Banner>
<Banner variant="warning">Scheduled maintenance on Saturday 10 pm - 2 am UTC.</Banner>
<Banner variant="danger">Service disruption in progress. We are investigating.</Banner>
With action button
Add an inline action alongside the message.
<Banner
variant="info"
actionText="Learn more"
onAction={() => navigate('/changelog')}
>
Version 0.10 is now available.
</Banner>
Dismissible banner
const [visible, setVisible] = useState(true);
{visible && (
<Banner variant="warning" onClose={() => setVisible(false)}>
Your session will expire in 5 minutes.
</Banner>
)}
Action and dismiss together
<Banner
variant="info"
actionText="Update now"
onAction={handleUpdate}
onClose={() => setVisible(false)}
>
A new version is available.
</Banner>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'info' | 'success' | 'warning' | 'danger' | 'info' | Semantic variant controlling colour. |
children | ReactNode | -- | Banner content. Keep brief -- one or two sentences. |
actionText | string | -- | Text for an inline action button. |
onAction | () => void | -- | Callback fired when the action button is clicked. |
onClose | () => void | -- | When provided, a dismiss button is rendered. |
className | string | -- | Additional CSS class names. |
Accessibility
- Uses
role="alert"fordangerandwarningvariants androle="status"forinfoandsuccess. - The dismiss button carries
aria-label="Dismiss banner". - Both the action and dismiss buttons have
:focus-visibleoutlines for keyboard navigation. - Banner content is centered with the close button absolutely positioned at the inline end, so content flow is not disrupted.