Skip to main content

notifications

The notifications configuration option in OpenKeyNav allows you to customize how notifications are displayed to users. These notifications provide feedback about the current mode (e.g., clicking mode, drag mode).

Purpose: Provides feedback to users regarding the current mode for a more cohesive user experience.

Configuration Option

notifications

  • Type: Object
  • Description: An object to configure notification settings.

Properties

  • enabled (boolean): Enables or disables notifications. Default is true.

  • displayToolName (boolean): Determines whether the OpenKeyNav name is displayed in notifications. Default is true.

    Including the OpenKeyNav name in notifications helps users who are already familiar with OpenKeyNav know how to use the keyboard features on your website, reminds them of where to look for support and documentation, and helps direct them to appropriate resources. The OpenKeyNav name provides meaningful context for the notifications announced to screen reader users. The notifications follow ARIA best practices and are announced to screen reader users with appropriate ARIA roles. This cohesive user experience can minimize support requests sent to your organization.

  • duration (number): Specifies how long (in milliseconds) each notification is displayed. Default is 3000 milliseconds.

Example

Here's an example of how to configure notifications in OpenKeyNav:

const openKeyNav = new OpenKeyNav();

const config = {
notifications: {
enabled: true, // Enable notifications
displayToolName: true, // Display the OpenKeyNav name in notifications
duration: 10000 // Set notification duration to 10 seconds
}
};

openKeyNav.init(config);

In this example, notifications are enabled, the duration is set to 10 seconds, and the OpenKeyNav name is included in the notifications.

By configuring the notifications option, you can tailor how users receive feedback while interacting with your web application, enhancing functionality and providing a cohesive user experience.