Notification banner
Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.
Read the Design System guidance for notification banner
Import
import * as NotificationBanner from 'govuk-react/notification-banner';Examples
Default
Code
<NotificationBanner.Root>
<NotificationBanner.Header>
<NotificationBanner.Title />
</NotificationBanner.Header>
<NotificationBanner.Content>
<NotificationBanner.Heading>
You have 7 days left to send your application.{' '}
<NotificationBanner.Link href="#">View application</NotificationBanner.Link>.
</NotificationBanner.Heading>
</NotificationBanner.Content>
</NotificationBanner.Root>Success
Code
<NotificationBanner.Root success disableAutoFocus={viewMode === 'docs'}>
<NotificationBanner.Header>
<NotificationBanner.Title>Success</NotificationBanner.Title>
</NotificationBanner.Header>
<NotificationBanner.Content>
<NotificationBanner.Heading>Training outcome recorded and trainee withdrawn</NotificationBanner.Heading>
<Body>
Contact <NotificationBanner.Link href="#">example@department.gov.uk</NotificationBanner.Link> if you think
there’s a problem.
</Body>
</NotificationBanner.Content>
</NotificationBanner.Root>API reference
NotificationBanner.Root
Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.
| Prop | Type |
|---|---|
successUse to tell the user about the outcome of something they’ve just done. The notification banner sets | boolean |
disableAutoFocusIf you set | boolean |
NotificationBanner.Composite
Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.
| Prop | Type |
|---|---|
successUse to tell the user about the outcome of something they’ve just done. The notification banner sets | boolean |
disableAutoFocusIf you set | boolean |
titleThe title that displays in the notification banner. Defaults to | ReactNode |
titleIdThe | string |
titleHeadingLevelSets heading level for the title only. You can only use values between | 1 | 2 | 3 | 4 | 5 | 6 |
heading | ReactNode |
NotificationBanner.Content
No props of its own. Other props are passed to the element it renders.
NotificationBanner.Header
No props of its own. Other props are passed to the element it renders.
NotificationBanner.Heading
No props of its own. Other props are passed to the element it renders.
NotificationBanner.Link
| Prop | Type |
|---|---|
asChildRender the only child (such as a router's link) instead of an | boolean |
NotificationBanner.Title
| Prop | Type |
|---|---|
headingLevelSets heading level for the title only. You can only use values between | 1 | 2 | 3 | 4 | 5 | 6 |