Raxol.Core.Accessibility.Metadata (Raxol v0.5.0)
View SourceHandles accessibility metadata for UI elements and component styles.
Summary
Functions
Get the accessible name for an element.
Get style settings for a component type.
Get metadata for an element.
Register style settings for a component type.
Register metadata for an element to be used for accessibility features.
Functions
Get the accessible name for an element.
Parameters
element
- The element to get the accessible name for
Returns
- The accessible name as a string, or nil if not found
Examples
iex> Metadata.get_accessible_name("search_button")
"Search"
Get style settings for a component type.
Parameters
component_type
- Atom representing the component type
Returns
- The style map for the component type, or empty map if not found
Examples
iex> Metadata.get_component_style(:button)
%{background: :blue}
Get metadata for an element.
Parameters
element_id
- Unique identifier for the element
Returns
- The metadata map for the element, or
nil
if not found
Examples
iex> Metadata.get_element_metadata("search_button")
%{label: "Search"}
Register style settings for a component type.
Parameters
component_type
- Atom representing the component typestyle
- Style map to associate with the component type
Examples
iex> Metadata.register_component_style(:button, %{background: :blue})
:ok
Register metadata for an element to be used for accessibility features.
Parameters
element_id
- Unique identifier for the elementmetadata
- Metadata to associate with the element
Examples
iex> Metadata.register_element_metadata("search_button", %{label: "Search"})
:ok