pub struct TabListProps {
pub tabs: LocalBoxSignalVec<'static, (String, String)>,
pub selected: LocalBoxSignal<'static, String>,
pub on_select: Box<dyn Fn(String) + 'static>,
pub aria_label: LocalBoxSignal<'static, String>,
pub apply: Option<Box<dyn FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement> + 'static>>,
}Expand description
An accessible tab list following the WAI-ARIA tabs pattern.
Renders a role="tablist" with one role="tab" button per (key, label)
entry. The selected tab is controlled by the selected key signal;
activating a tab (click, Enter, or Space) invokes on_select with its key.
Keyboard support: Left/Right arrows move selection and focus to the
previous/next tab (wrapping), Home/End jump to the first/last tab.
Each tab gets the DOM id {tablist-id}-tab-{key}, so tab panels can point
back at their tab via aria-labelledby.
Fields§
§tabs: LocalBoxSignalVec<'static, (String, String)>§selected: LocalBoxSignal<'static, String>§on_select: Box<dyn Fn(String) + 'static>§aria_label: LocalBoxSignal<'static, String>§apply: Option<Box<dyn FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement> + 'static>>Implementations§
Source§impl TabListProps
impl TabListProps
Source§impl TabListProps
impl TabListProps
pub fn tabs(self, v: impl Into<Vec<(String, String)>>) -> TabListProps
pub fn tabs_signal_vec( self, v: impl SignalVec<Item = (String, String)> + 'static, ) -> TabListProps
Source§impl TabListProps
impl TabListProps
pub fn selected(self, v: String) -> TabListProps
pub fn selected_signal( self, v: impl Signal<Item = String> + 'static, ) -> TabListProps
Source§impl TabListProps
impl TabListProps
pub fn on_select(self, v: impl Fn(String) + 'static) -> TabListProps
Source§impl TabListProps
impl TabListProps
Sourcepub fn aria_label(self, v: String) -> TabListProps
pub fn aria_label(self, v: String) -> TabListProps
Accessible name for the tab list
Sourcepub fn aria_label_signal(
self,
v: impl Signal<Item = String> + 'static,
) -> TabListProps
pub fn aria_label_signal( self, v: impl Signal<Item = String> + 'static, ) -> TabListProps
Accessible name for the tab list
Source§impl TabListProps
impl TabListProps
pub fn apply( self, v: impl FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement> + 'static, ) -> TabListProps
Auto Trait Implementations§
impl !RefUnwindSafe for TabListProps
impl !Send for TabListProps
impl !Sync for TabListProps
impl !UnwindSafe for TabListProps
impl Freeze for TabListProps
impl Unpin for TabListProps
impl UnsafeUnpin for TabListProps
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
Mutably borrows from an owned value. Read more