pub struct A11yBuilder { /* private fields */ }Expand description
The annotations .a11y(|a| …) collects (docs/accessibility.md). The three strings are
TextSources, so each takes a literal, a String, a Signal<String> or a closure: a
gauge’s value follows the gauge, and a localized label follows the locale.
Implementations§
Source§impl A11yBuilder
impl A11yBuilder
Sourcepub fn hint<M>(self, s: impl IntoText<M>) -> Self
pub fn hint<M>(self, s: impl IntoText<M>) -> Self
A longer description of what the element does.
Sourcepub fn value<M>(self, s: impl IntoText<M>) -> Self
pub fn value<M>(self, s: impl IntoText<M>) -> Self
The control’s current value read aloud by the screen reader (e.g. a Meter’s “72%”).
Reactive like the others: .value(move || format!("{:.0}%", level.get())) re-sends the
value whenever level changes.
pub fn role(self, r: Role) -> Self
Sourcepub fn selected<M>(self, on: impl IntoReactive<bool, M>) -> Self
pub fn selected<M>(self, on: impl IntoReactive<bool, M>) -> Self
Whether this element is the selected one among its peers (a Role::Tab, a row): the
platform’s selected state, which a screen reader reads as “selected”. Reactive like the
strings: .selected(move || current.get() == key) re-sends it when the selection moves.
Hide this element from assistive tech (still visible on screen), e.g. a redundant chrome element already announced by its labeled sibling.
Sourcepub fn decorative(self) -> Self
pub fn decorative(self) -> Self
Purely decorative (a background flourish): hidden from assistive tech and, for images, exempt from the “needs a label” lint (§13).
Trait Implementations§
Source§impl Default for A11yBuilder
impl Default for A11yBuilder
Source§fn default() -> A11yBuilder
fn default() -> A11yBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for A11yBuilder
impl !Send for A11yBuilder
impl !Sync for A11yBuilder
impl !UnwindSafe for A11yBuilder
impl Freeze for A11yBuilder
impl Unpin for A11yBuilder
impl UnsafeUnpin for A11yBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more