<Notification>
Component<Notificationdescription="lAliquet in lacus, scelerisque tristique purus. Lob ortis felis orci lacus egestas et turpis."cta={{title: 'Standalone link',url: '/'}}onDismiss={() => {}}/>
Name | Description |
---|---|
appearance string | Render on light or dark background. |
description* string | The text that appears within the notification. |
cta* object | Object contains nested props, see below: |
cta.title* string | The text used within the link. |
cta.url* string | The url used within the link. |
cta.onClick function | An optional function that will be called when the button is clicked. |
onDismiss* function | A function called when the close button is clicked. |
notification
API
Import and add the <Notifications />
component within your App file. Ensure your app is wrapped the MotionConfig component to lazy load Framer Motion features.
Render a notification using the notification
function. Below we demonstrate how you can render a notification on page load, and also based on a user interaction.
While we recommend you use the appropriate Notification UI components, you have the ability to render custom markup using the notification function.
<NotificationWithLanguagelanguage="en"description="lAliquet in lacus, scelerisque tristique purus. Lob ortis felis orci lacus egestas et turpis."cta={{title: 'Standalone link',url: '/'}}onDismiss={() => {}}/>
<NotificationWithProductproduct="vault"description="lAliquet in lacus, scelerisque tristique purus. Lob ortis felis orci lacus egestas et turpis."cta={{title: 'Standalone link',url: '/'}}onDismiss={() => {}}/>
<NotificationWithResourcetype="webinar"description="lAliquet in lacus, scelerisque tristique purus. Lob ortis felis orci lacus egestas et turpis."cta={{title: 'Standalone link',url: '/'}}onDismiss={() => {}}/>
<NotificationWithThumbnailthumbnail={{src: 'https://www.datocms-assets.com/2885/1651495958-infrastructure.png',alt: 'HashiCorp Infrastructure'}}description="lAliquet in lacus, scelerisque tristique purus. Lob ortis felis orci lacus egestas et turpis."cta={{title: 'Standalone link',url: '/'}}onDismiss={() => {}}/>
<NotificationWithActionsheading="Notification heading"description="lAliquet in lacus, scelerisque tristique purus. Lob ortis felis orci lacus egestas et turpis."actions={[{title: 'Primary action',onClick: () => {}},{title: 'Secondary action',onClick: () => {}},]}onDismiss={() => {}}/>