AriaLiveAnnouncer (ui)
@ckeditor/ckeditor5-ui/src/arialiveannouncer
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
-
The editor instance.
-
view : AriaLiveAnnouncerView | undefined
module:ui/arialiveannouncer~AriaLiveAnnouncer#view
The view that aggregates all
aria-live
regions.
Methods
-
constructor( editor )
module:ui/arialiveannouncer~AriaLiveAnnouncer#constructor
-
announce( announcement, attributes ) → void
module:ui/arialiveannouncer~AriaLiveAnnouncer#announce
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
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.