pub struct Tabs { /* private fields */ }Expand description
A strip of tabs: links between pages, or panels switched in place.
let t = Tabs![selected = "b", Tab![key = "a", title = "A", p!["one"]], Tab![key = "b", title = "B", p!["two"]]];
let html = render_static(t);
assert!(html.contains(r#"role="tablist""#) && html.contains(r#"aria-selected="true""#));
assert!(html.contains(r#"tabindex="0" hidden>"#), "the unselected panel is hidden");Implementations§
Source§impl Tabs
impl Tabs
pub fn new() -> Self
Sourcepub fn class(self, v: impl Into<String>) -> Self
pub fn class(self, v: impl Into<String>) -> Self
Extra classes for the outer element. They win over the defaults.
pub fn tabs(self, v: impl IntoIterator<Item = Tab>) -> Self
pub fn variant(self, v: TabsVariant) -> Self
pub fn color(self, v: Color) -> Self
pub fn size(self, v: Size) -> Self
pub fn radius(self, v: Radius) -> Self
Sourcepub fn selected(self, v: impl Into<String>) -> Self
pub fn selected(self, v: impl Into<String>) -> Self
The key of the selected tab (otherwise the first, or the one marked).
Sourcepub fn full_width(self, v: bool) -> Self
pub fn full_width(self, v: bool) -> Self
Tabs share the width of the strip.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Tabs
impl !Sync for Tabs
impl !UnwindSafe for Tabs
impl Forget for Tabs
impl Freeze for Tabs
impl Move for Tabs
impl Send for Tabs
impl Unpin for Tabs
impl UnsafeUnpin for Tabs
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