Skip to main content

Notification
New

Notifications encourage users to take an action related to a recent update or an opportunity. They are most commonly displayed inside Notification Drawer.

Notification is a component intended for use inside Notification Drawer. A notification consists of a link, a date, and content. For more usage examples, please see the Notification Drawer component.

Examples

Open in new window
<duet-notification highlight url="https://www.duetds.com" date="23.11.2020">
<duet-heading level="h2" visual-level="h6">
Uusi vakuutus
</duet-heading>
<duet-paragraph size="small" margin="none">
Uuden kotivakuutuksesi tiedot ja asiakirjat löydät klikkaamalla tästä.
</duet-paragraph>
</duet-notification>
<duet-notification url="https://www.duetds.com" date="12.10.2020">
<duet-heading level="h2" visual-level="h6">
Vakuutuskausi vaihtuu
</duet-heading>
<duet-paragraph size="small" margin="none">
Kotivakuutuksesi uuden vakuutuskauden asiakirjat löydät täältä.
</duet-paragraph>
</duet-notification>
<duet-notification url="https://www.duetds.com" date="8.10.2020">
<duet-heading level="h2" visual-level="h6">
Muutosvahvistus
</duet-heading>
<duet-paragraph size="small" margin="none">
Olet tehnyt muutoksia kotivakuutukseesi. Tarkista täältä että kaikki tiedot ovat oikein.
</duet-paragraph>
</duet-notification>
<duet-notification url="https://www.duetds.com" date="6.6.2020">
<duet-heading level="h2" visual-level="h6">
Uusi vakuutus
</duet-heading>
<duet-paragraph size="small" margin="none">
Uuden kotivakuutuksesi tiedot ja asiakirjat löydät täältä.
</duet-paragraph>
</duet-notification>
Open in new window
<duet-notification highlight url="https://www.duetds.com" date="23.11.2020">
<duet-heading level="h2" visual-level="h6">
Uusi vakuutus
</duet-heading>
<duet-paragraph size="small" margin="none">
Uuden kotivakuutuksesi tiedot ja asiakirjat löydät klikkaamalla tästä.
</duet-paragraph>
</duet-notification>
Open in new window
<duet-notification highlight url="https://www.duetds.com" date="23.11.2020">
<duet-heading margin="none" level="h2" visual-level="h6">
Lataa uusi sovellus puhelimeesi
</duet-heading>
</duet-notification>
<duet-notification url="https://www.duetds.com" date="12.10.2020">
<duet-heading margin="none" level="h2" visual-level="h6">
Vakuutuskausi vaihtuu
</duet-heading>
</duet-notification>
<duet-notification url="https://www.duetds.com" date="8.10.2020">
<duet-heading margin="none" level="h2" visual-level="h6">
Korkohyvitys vuodelle 2019
</duet-heading>
</duet-notification>
<duet-notification url="https://www.duetds.com" date="6.6.2020">
<duet-heading margin="none" level="h2" visual-level="h6">
Tietoa muutoksista verkkopalvelussa
</duet-heading>
</duet-notification>

Properties #

Property Attribute Description Type Default
date date The date of the notification. string ""
external external Should the link open in a new window? boolean false
highlight highlight Should the notification be visually highlighted? boolean false
language language The currently active language. Used for announcing unread notifications to screen readers. "en" | "fi" | "sv" "fi"
theme theme Theme of the notification. "" | "default" | "turva" ""
url url The url to open on notification click. string "#"

Methods #

setFocus(options?: FocusOptions) => Promise<void> #

Move focus to the notification's link element.
Use this method instead of the native focus() method.

Returns #

Type: Promise<void>


Usage #

This section includes guidelines for designers and developers about the usage of this component in different contexts.

When to use #

  • For use inside notification drawer component to generate a notification.
  • When showing 80 or less characters in the notification heading.
  • When showing 120 or less characters in the notification paragraph.

When not to use #

  • Outside of notification drawer component.
  • When you have more than 80 characters in the heading. Please enable text truncation in your app.
  • When you have more than 120 characters in the paragraph. Please enable text truncation in your app.

Accessibility #

This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.

Additional considerations #


Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.



Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Abstract

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown

Tutorials

VS Code

Tutorials

Zeplin


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.