Raxol.Core.Accessibility.Roles (Raxol Core v2.6.0)

Copy Markdown View Source

The ARIA role vocabulary for the accessibility tree.

Maps a declaration Element :type to a standard ARIA role and answers which roles are live regions. This is the single source of truth for the default type -> role mapping; Components that implement Raxol.Core.Accessibility.Provider may override the role for their own node, but the values here are the vocabulary they should draw from.

Interactive and structural Components map to standard ARIA roles. Tables map to :grid (arrow-navigable, focusable cells) rather than the static :table. Layout containers map to :group; bare text maps to :text. Unknown types fall back to :generic so the projection is total.

Summary

Functions

The conventional child role for a container role, or nil.

The fallback role for Elements with no mapping.

Whether a role denotes a live region (announced as it changes).

The ARIA role for a declaration Element type. Unknown types -> :generic.

Functions

child_role(role)

@spec child_role(atom()) :: atom() | nil

The conventional child role for a container role, or nil.

default_role()

@spec default_role() :: atom()

The fallback role for Elements with no mapping.

live?(role)

@spec live?(atom()) :: boolean()

Whether a role denotes a live region (announced as it changes).

role_for(type)

@spec role_for(term()) :: atom()

The ARIA role for a declaration Element type. Unknown types -> :generic.