Class

AriaLiveAnnouncer (ui)

@ckeditor/ckeditor5-ui/src/arialiveannouncer

class

An accessibility helper that manages all ARIA live regions associated with an editor instance. ARIA live regions announce changes to the state of the editor features.

These announcements are consumed and propagated by screen readers and give users a better understanding of the current state of the editor.

To announce a state change to an editor use the announce method:

editor.ui.ariaLiveAnnouncer.announce( 'Text of an announcement.' );

Filtering

Properties

Methods

  • constructor( editor )

    Parameters

    editor : Editor
  • announce( announcement, attributes ) → void

    Sets an announcement text to an aria region that is then announced by a screen reader to the user.

    If the aria region of a specified politeness does not exist, it will be created and can be re-used later.

    The default announcement politeness level is 'polite'.

    // Most screen readers will queue announcements from multiple aria-live regions and read them out in the order they were emitted.
     * editor.ui.ariaLiveAnnouncer.announce( 'Image uploaded.' );
     * editor.ui.ariaLiveAnnouncer.announce( 'Connection lost. Reconnecting.' );
     * ```

    Parameters

    announcement : string
    attributes : AriaLiveAnnouncerPolitenessValue | AriaLiveAnnounceConfig

    Defaults to AriaLiveAnnouncerPoliteness.POLITE

    Returns

    void