Skip to main content

Notification Ready

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
<div role="list">
<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>
</div>
Open in new window
<div role="list">
<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>
</div>
Open in new window
<div role="list">
<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>
</div>

Properties #

Property Attribute Description Type Default
accessibleLabelUnread accessible-label-unread Adds accessible label for tooltip that is shown over unread counter string getLocaleString( this.accessibleLabelUnreadDefaults, this.language )
accessibleLabelUnreadDefaults -- Property to change accessibleLabelUnread defaults on the component. normally you would handle these strings on an application level and override accessibleLabelUnread when needed DuetLangObject { en: "Unread", fi: "Lukematon", sv: "Oläst", }
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 [DEPRECATED] this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing

The currently active language. Used for announcing unread notifications to screen readers.
"en" | "fi" | "sv" getLanguage()
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.

Parameters #

Name Type Description
options FocusOptions

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.

Integration guidelines


Tutorials

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

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown


Troubleshooting

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