Raxol.Core.Accessibility.Announcements (Raxol v2.0.1)
View SourceHandles screen reader announcements and announcement queue management.
Summary
Functions
Make an announcement for screen readers.
Returns a specification to start this module under a supervisor.
Clear all pending announcements.
Clear all pending announcements for a specific user.
Get the next announcement to be read by screen readers for a specific user/context.
Functions
Make an announcement for screen readers.
Parameters
message- The message to announceopts- Options for the announcementuser_preferences_pid_or_name- The PID or registered name of the UserPreferences process to use (optional).
Options
:priority- Priority level (:low,:medium,:high) (default::medium):interrupt- Whether to interrupt current announcements (default:false)
Examples
iex> Announcements.announce("Button clicked")
:ok
iex> Announcements.announce("Error occurred", priority: :high, interrupt: true)
:ok
Returns a specification to start this module under a supervisor.
See Supervisor.
Clear all pending announcements.
Examples
iex> Announcements.clear_announcements()
:ok
Clear all pending announcements for a specific user.
Examples
iex> Announcements.clear_announcements(:user_prefs)
:ok
Get the next announcement to be read by screen readers for a specific user/context.
Parameters
user_preferences_pid_or_name- The PID or registered name of the UserPreferences process to use (optional).
Examples
iex> Announcements.get_next_announcement(:user1)
"Button clicked"