Announcement
On this page
Overview
Announcements are flexible surfaces used to group information in a full width
banner layout, traditionally across the top of a page. They are used to
announce new features, promos, or news. Use dismissable to add a close
button. Supports color-palette for light/dark themes. Keyboard users
should be able to tab to and activate interactive elements. Slotted content
provides screen reader context and should include meaningful text.
Edit element properties
import '@rhds/elements/rh-cta/rh-cta.js';
import '@rhds/elements/rh-announcement/rh-announcement.js';
<rh-announcement>
<svg slot="image" width="80" height="48" role="img" aria-label="Sample image">
<rect fill="light-dark(var(--rh-color-surface-dark, #383838), var(--rh-color-surface-light, #e0e0e0))" stroke="var(--rh-color-border-subtle)" stroke-width="2px" width="100%" height="100%" stroke-dasharray="4 4">
</rect>
<text x="17" y="30" style="font-family: var(--rh-font-family-code, RedHatMono, 'Red Hat Mono', 'Courier New', Courier, monospace); font-size: var(--rh-font-size-body-text-md, 1rem);" fill="light-dark(var(--rh-color-text-primary-on-dark, #ffffff), var(--rh-color-text-primary-on-light, #151515))">
Image
</text>
</svg>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit adipisicing elit adipisicing elit.</p>
<rh-cta slot="cta" href="#">Learn More</rh-cta>
</rh-announcement>
<link rel="stylesheet" href="../rh-announcement-lightdom-shim.css">
import { Announcement } from "@rhds/elements/react/rh-announcement/rh-announcement.js";
import { Cta } from "@rhds/elements/react/rh-cta/rh-cta.js";
// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.
export const Demo = () => (
<Announcement>
<svg slot="image" width="80" height="48" role="img" aria-label="Sample image">
<rect fill="light-dark(var(--rh-color-surface-dark, #383838), var(--rh-color-surface-light, #e0e0e0))" stroke="var(--rh-color-border-subtle)" stroke-width="2px" width="100%" height="100%" stroke-dasharray="4 4" />
<text x="17" y="30" style="font-family: var(--rh-font-family-code, RedHatMono, 'Red Hat Mono', 'Courier New', Courier, monospace); font-size: var(--rh-font-size-body-text-md, 1rem);" fill="light-dark(var(--rh-color-text-primary-on-dark, #ffffff), var(--rh-color-text-primary-on-light, #151515))">Image</text>
</svg>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit adipisicing elit adipisicing elit.</p>
<Cta slot="cta" href="#">Learn More</Cta>
</Announcement>
<link rel="stylesheet" href="../rh-announcement-lightdom-shim.css" />
);
Sets the color context for child components, overriding any inherited
parent context. Valid values include light, dark, and other
palette names defined by the design system. Determines surface and
text colors. Should contrast with adjacent surfaces (e.g., avoid
using a dark announcement above a dark navigation).
When true, renders a close button that allows the user to dismiss the
announcement. Pressing Enter or Space on the close button fires a
cancelable close event. If the event is not canceled, the element is
removed from the DOM.
Controls the position of the slotted image on mobile viewports.
inline-start keeps the image beside the body text; block-start
places it above. On wider viewports (768px+), images always appear
inline. When unset, the image appears above content on mobile.
Status
- Figma library:
-
Ready - RH Elements:
-
Ready - RH Shared Libs:
-
Planned
When to use
- Display an important message across many pages or page types
- Only to be implemented through the personalization program
Benefits
- Profile - thin design that does not push content down too much
- Lots of eyes - has the potential to be seen across many pages or page types
- Minimal elements - only body text and a call to action are required at a minimum
- Maximum visibility - spans the entire width of the browser window
- Customization - includes slots for further customization like inline or background images
- Control - if included, a close button offers a way for users to close the pattern
Status checklist
| Property | Status | Meaning |
|---|---|---|
| Figma library |
|
Component is available in the Figma library |
| RH Elements |
|
Component is available in RH Elements |
| RH Shared Libs |
|
Component will be added to RH Shared Libs |
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.
Other libraries
To learn more about our other libraries, visit the getting started page.