Sr alert message

From Legal-and-General/canopy · View interactive version

Sr alert message is an AI agent skill from the GitHub repository Legal-and-General/canopy. Best practices for the Canopy Screen Reader Alert Message directive. Trigger when notifying screen reader users of dynamic content changes, loading completion, or status updates in an Angular project using Canopy.

How to use this skill

Skill file

Canopy Screen Reader Alert Message — Best Practices

This skill provides usage guidance and input reference for the Canopy lgSrAlertMessage directive (LgSrAlertMessageDirective) from @legal-and-general/canopy.

Apply this skill whenever you use LgSrAlertMessageDirective or lgSrAlertMessage.


Import

import { LgSrAlertMessageDirective } from '@legal-and-general/canopy';

Basic Usage

Apply the directive to a paragraph containing the message for screen readers. Pass a boolean binding: when it becomes true the message is read aloud and then hidden after a timeout.

@if (!loaded) {
  <lg-spinner></lg-spinner>
}
<p [lgSrAlertMessage]="loaded">Loading complete</p>

Inputs

| Input | Type | Default | Required | Description |

|-------|------|---------|----------|-------------|

| lgSrAlertMessage | boolean | null | Yes | When true, the message is read by screen readers and hidden after timer ms. |

| timer | number | 8000 | No | Time in milliseconds before the message is hidden from screen readers. |


When to Use

Use lgSrAlertMessage whenever content changes dynamically in a way that sighted users notice visually but screen reader users would not detect — for example:


Design Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.