pub struct AriaAttributes {Show 23 fields
pub role: Option<String>,
pub label: Option<String>,
pub described_by: Option<String>,
pub hidden: bool,
pub expanded: Option<bool>,
pub selected: Option<bool>,
pub checked: Option<AriaChecked>,
pub pressed: Option<AriaChecked>,
pub disabled: bool,
pub required: bool,
pub invalid: bool,
pub value_now: Option<f64>,
pub value_min: Option<f64>,
pub value_max: Option<f64>,
pub value_text: Option<String>,
pub level: Option<u8>,
pub pos_in_set: Option<u32>,
pub set_size: Option<u32>,
pub controls: Option<String>,
pub has_popup: Option<String>,
pub busy: bool,
pub live: Option<AriaLive>,
pub atomic: bool,
}Expand description
ARIA attributes for a widget.
Fields§
§role: Option<String>The ARIA role
label: Option<String>Accessible label
described_by: Option<String>Accessible description
Whether element is hidden from accessibility tree
expanded: Option<bool>Whether element is expanded (for expandable elements)
selected: Option<bool>Whether element is selected
checked: Option<AriaChecked>Whether element is checked (for checkboxes/switches)
pressed: Option<AriaChecked>Whether element is pressed (for toggle buttons)
disabled: boolWhether element is disabled
required: boolWhether element is required
invalid: boolWhether element is invalid
value_now: Option<f64>Current value for range widgets
value_min: Option<f64>Minimum value for range widgets
value_max: Option<f64>Maximum value for range widgets
value_text: Option<String>Text representation of value
level: Option<u8>Level (for headings)
pos_in_set: Option<u32>Position in set
set_size: Option<u32>Set size
controls: Option<String>Controls another element (ID reference)
has_popup: Option<String>Has popup indicator
busy: boolIs busy/loading
live: Option<AriaLive>Live region politeness
atomic: boolAtomic live region
Implementations§
Source§impl AriaAttributes
impl AriaAttributes
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set the label.
Set hidden.
Sourcepub const fn with_expanded(self, expanded: bool) -> Self
pub const fn with_expanded(self, expanded: bool) -> Self
Set expanded state.
Sourcepub const fn with_selected(self, selected: bool) -> Self
pub const fn with_selected(self, selected: bool) -> Self
Set selected state.
Sourcepub const fn with_checked(self, checked: AriaChecked) -> Self
pub const fn with_checked(self, checked: AriaChecked) -> Self
Set checked state.
Sourcepub const fn with_pressed(self, pressed: AriaChecked) -> Self
pub const fn with_pressed(self, pressed: AriaChecked) -> Self
Set pressed state (for toggle buttons).
Sourcepub const fn with_disabled(self, disabled: bool) -> Self
pub const fn with_disabled(self, disabled: bool) -> Self
Set disabled state.
Sourcepub const fn with_atomic(self, atomic: bool) -> Self
pub const fn with_atomic(self, atomic: bool) -> Self
Set atomic.
Sourcepub fn with_range(self, min: f64, max: f64, now: f64) -> Self
pub fn with_range(self, min: f64, max: f64, now: f64) -> Self
Set range values.
Sourcepub const fn with_value_now(self, value: f64) -> Self
pub const fn with_value_now(self, value: f64) -> Self
Set current value.
Sourcepub const fn with_value_min(self, value: f64) -> Self
pub const fn with_value_min(self, value: f64) -> Self
Set minimum value.
Sourcepub const fn with_value_max(self, value: f64) -> Self
pub const fn with_value_max(self, value: f64) -> Self
Set maximum value.
Sourcepub fn with_controls(self, controls: impl Into<String>) -> Self
pub fn with_controls(self, controls: impl Into<String>) -> Self
Set controls reference.
Sourcepub fn with_described_by(self, described_by: impl Into<String>) -> Self
pub fn with_described_by(self, described_by: impl Into<String>) -> Self
Set described by reference.
Sourcepub fn with_has_popup(self, has_popup: impl Into<String>) -> Self
pub fn with_has_popup(self, has_popup: impl Into<String>) -> Self
Set has popup.
Sourcepub const fn with_level(self, level: u8) -> Self
pub const fn with_level(self, level: u8) -> Self
Set heading level.
Sourcepub const fn with_pos_in_set(self, pos: u32, size: u32) -> Self
pub const fn with_pos_in_set(self, pos: u32, size: u32) -> Self
Set position in set.
Sourcepub fn to_html_attrs(&self) -> Vec<(String, String)>
pub fn to_html_attrs(&self) -> Vec<(String, String)>
Generate HTML ARIA attributes.
Sourcepub fn to_html_string(&self) -> String
pub fn to_html_string(&self) -> String
Generate HTML attribute string.
Trait Implementations§
Source§impl Clone for AriaAttributes
impl Clone for AriaAttributes
Source§fn clone(&self) -> AriaAttributes
fn clone(&self) -> AriaAttributes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more