pub struct NavigationItem { /* private fields */ }Expand description
One destination or tab with an ID unique within its collection.
Implementations§
pub fn new( id: impl Into<SharedString>, label: impl Into<SharedString>, ) -> NavigationItem
pub fn icon(self, icon: Icon) -> NavigationItem
pub fn disabled(self, disabled: bool) -> NavigationItem
Sourcepub fn icon_position(
self,
position: NavigationItemIconPosition,
) -> NavigationItem
pub fn icon_position( self, position: NavigationItemIconPosition, ) -> NavigationItem
Overrides icon placement inherited from the tab, bar, or rail.
Sourcepub fn label_content(self, content: impl IntoElement) -> NavigationItem
pub fn label_content(self, content: impl IntoElement) -> NavigationItem
Replaces the visible label while retaining the accessible name.
Sourcepub fn badge(self, badge: Badge) -> NavigationItem
pub fn badge(self, badge: Badge) -> NavigationItem
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,
) -> NavigationItem
pub fn indicator_padding( self, collapsed: NavigationRailPadding, expanded: NavigationRailPadding, ) -> NavigationItem
Sets the rail indicator’s logical content padding without shrinking its target.
Sourcepub fn colors(self, colors: NavigationItemColors) -> NavigationItem
pub fn colors(self, colors: NavigationItemColors) -> NavigationItem
Sets per-state pigments for a navigation or tab destination.
Sourcepub fn interaction_source(
self,
source: &Entity<InteractionSource>,
) -> NavigationItem
pub fn interaction_source( self, source: &Entity<InteractionSource>, ) -> NavigationItem
Observes the destination using its collection ID and item ID.
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