Notice
Notification card component for displaying updates, messages, and alerts in notification centers and activity feeds. Supports structured content with headers, body, footer, actions, and metadata.
Example
<article class="omni-notice" data-variant="info">
<div class="omni-notice-header">
New Feature Available
</div>
<div class="omni-notice-body">
We've added support for dark mode across the entire platform.
</div>
<div class="omni-notice-footer">
2 hours ago
</div>
</article>
When to Use Notice vs Alert vs Banner
| Component | Use Case | Typical Location | Element |
|---|---|---|---|
| Notice | Notification centers, activity feeds, message lists | Dedicated notification area, sidebar, dropdown | <article> |
| Alert | Inline contextual feedback, form validation, status messages | Within page content, above forms, contextual areas | <div> |
| Banner | Full-width announcements, system-wide messages, cookie consent | Top/bottom of page, sticky/fixed position | <div> |
Variants
Semantic Variants
Use data-variant to convey meaning through header color:
<article class="omni-notice" data-variant="success">
<div class="omni-notice-header">Payment Successful</div>
<div class="omni-notice-body">Your payment has been processed.</div>
</article>
Unread State
Use data-state="unread" to highlight unread notifications with a blue accent border and indicator dot:
<article class="omni-notice" data-state="unread" aria-label="Unread notification">
<div class="omni-notice-header">New Message</div>
<div class="omni-notice-body">You have a new message.</div>
</article>
Compact Size
Use data-size="compact" for tighter spacing in notification lists:
<article class="omni-notice" data-size="compact">
<div class="omni-notice-body">Quick notification message.</div>
<div class="omni-notice-footer">2 hours ago</div>
</article>
Structure
With Header, Body, and Footer
Structured notices with distinct header, body, and footer sections:
Simple (No Structure)
For simple notifications, you can omit the child components and use the notice directly:
<article class="omni-notice" data-variant="info">
Simple notification text.
</article>
With Icon
Add an icon to the notice body using data-has-icon="true" and the omni-notice-icon class:
<article class="omni-notice" data-variant="success">
<div class="omni-notice-header">Order Shipped</div>
<div class="omni-notice-body" data-has-icon="true">
<div class="omni-notice-icon">
<svg>...</svg>
</div>
<div>Your order has been shipped.</div>
</div>
</article>
With Metadata
Add metadata like timestamps or categories using omni-notice-meta:
<article class="omni-notice" data-variant="primary">
<div class="omni-notice-header">Comment on Your Post</div>
<div class="omni-notice-body">
Jane Cooper commented: "Great article!"
<div class="omni-notice-meta">
<span class="omni-notice-time">2 hours ago</span>
<span>•</span>
<span>Blog Posts</span>
</div>
</div>
</article>
With Actions
Add action buttons using omni-notice-actions and standard button components:
<article class="omni-notice" data-variant="info">
<div class="omni-notice-header">Friend Request</div>
<div class="omni-notice-body">
Alex Morgan sent you a friend request.
<div class="omni-notice-actions">
<button class="omni-button" data-variant="primary" data-size="sm">Accept</button>
<button class="omni-button" data-variant="secondary" data-size="sm">Decline</button>
</div>
</div>
</article>
Notification List
Group multiple notices in a notification center using a <section> with aria-label:
<section aria-label="Notifications">
<article class="omni-notice" data-state="unread">
<div class="omni-notice-header">New Message</div>
<div class="omni-notice-body">You have 3 unread messages.</div>
</article>
<article class="omni-notice" data-variant="success">
<div class="omni-notice-header">Deployment Complete</div>
<div class="omni-notice-body">Successfully deployed.</div>
</article>
</section>
API Reference
Notice Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
data-variant |
primary, success, warning, danger, info | — | Semantic color applied to header |
data-state |
unread | — | Unread indicator with accent border |
data-size |
compact | — | Compact spacing for notification lists |
Notice Components
| Class | Description |
|---|---|
.omni-notice |
Base notice container (use <article> in lists) |
.omni-notice-header |
Colored header bar with title text |
.omni-notice-body |
Main content area |
.omni-notice-footer |
Footer area (typically for timestamps) |
.omni-notice-icon |
Icon container (use with data-has-icon="true" on body) |
.omni-notice-meta |
Metadata container (timestamp, category, etc.) |
.omni-notice-time |
Timestamp text |
.omni-notice-actions |
Action buttons container |
Accessibility
- Use
<article>for individual notices in a notification list - Wrap notification lists in
<section aria-label="Notifications"> - For dynamic notices added via JS, use
role="status"(polite) orrole="alert"(assertive) - Unread notices should include
aria-label="Unread notification" - Timestamps should use
<time>element withdatetimeattribute when possible - Action buttons maintain full keyboard navigation and focus indicators
- Hover effect provides visual feedback for interactive notices
ARIA Roles Reference
<!-- For notification lists -->
<section aria-label="Notifications">
<article class="omni-notice">...</article>
</section>
<!-- For dynamic advisory updates -->
<div class="omni-notice" role="status">...</div>
<!-- For dynamic urgent updates -->
<div class="omni-notice" role="alert">...</div>
<!-- For unread notices -->
<article class="omni-notice" data-state="unread" aria-label="Unread notification">
...
</article>
Components Used
Other OmniUI components demonstrated on this page: