pub struct NavigationItem { /* private fields */ }Expand description
One destination or tab with an ID unique within its collection.
Implementations§
Sourcepub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
pub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
Creates a navigation destination or tab with a unique ID and visible label.
Sourcepub fn disabled(self, disabled: bool) -> Self
pub fn disabled(self, disabled: bool) -> Self
Disables pointer and keyboard activation for this destination.
Sourcepub fn icon_position(self, position: NavigationItemIconPosition) -> Self
pub fn icon_position(self, position: NavigationItemIconPosition) -> Self
Overrides icon placement inherited from the tab, bar, or rail.
Sourcepub fn label_content(self, content: impl IntoElement) -> Self
pub fn label_content(self, content: impl IntoElement) -> Self
Replaces the visible label while retaining the accessible name.
Sourcepub fn badge(self, badge: Badge) -> Self
pub fn badge(self, badge: Badge) -> Self
Anchors a standalone badge to the icon, or to the label if there is no icon. An accessible badge label becomes the destination’s description.
Sourcepub fn indicator_padding(
self,
collapsed: NavigationRailPadding,
expanded: NavigationRailPadding,
) -> Self
pub fn indicator_padding( self, collapsed: NavigationRailPadding, expanded: NavigationRailPadding, ) -> Self
Sets the rail indicator’s logical content padding without shrinking its target.
Sourcepub fn colors(self, colors: NavigationItemColors) -> Self
pub fn colors(self, colors: NavigationItemColors) -> Self
Sets per-state pigments for a navigation or tab destination.
Sourcepub fn interaction_source(self, source: &Entity<InteractionSource>) -> Self
pub fn interaction_source(self, source: &Entity<InteractionSource>) -> Self
Observes the destination using its collection ID and item ID.
Trait Implementations§
Source§fn from(item: NavigationItem) -> Self
fn from(item: NavigationItem) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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