pub struct NavigationRailProps {
pub items: Vec<NavItemView>,
pub active: AppSection,
pub workspace: WorkspaceBadgeView,
pub user: Option<UserAvatarView>,
pub workspace_open: bool,
pub on_select: Option<Callback<AppSection>>,
}Expand description
Props for the NavigationRail component.
§Required Props
- items:
Vec<NavItemView>- List of nav items in display order (top to bottom).
- active:
AppSection- The currently-active section. The matching item gets the
nav-rail-item-activeclass.
- The currently-active section. The matching item gets the
- workspace:
WorkspaceBadgeView- Top-of-rail workspace marker.
§Optional Props
- user:
UserAvatarView- Optional bottom-of-rail user avatar.
- workspace_open:
booltruewhen the workspace switcher menu is open — controls the badge’sopenstate.
- on_select: [
Callback<AppSection>]- Optional callback fired when the user clicks an enabled rail
item (M-TRAY.2 / AUT-251). The argument is the clicked item’s
AppSection. M-TRAY.4 (AUT-253) wires this incrates/app-uito drive the active-surface signal; the storybook stories leave itNoneso SSR snapshots stay identical to the pre-callback baseline. Disabled items never fire the callback.
- Optional callback fired when the user clicks an enabled rail
item (M-TRAY.2 / AUT-251). The argument is the clicked item’s
Fields§
§items: Vec<NavItemView>List of nav items in display order (top to bottom).
active: AppSectionThe currently-active section. The matching item gets the
nav-rail-item-active class.
workspace: WorkspaceBadgeViewTop-of-rail workspace marker.
user: Option<UserAvatarView>Optional bottom-of-rail user avatar.
workspace_open: booltrue when the workspace switcher menu is open — controls the
badge’s open state.
on_select: Option<Callback<AppSection>>Optional callback fired when the user clicks an enabled rail
item (M-TRAY.2 / AUT-251). The argument is the clicked item’s
AppSection. M-TRAY.4 (AUT-253) wires this in
crates/app-ui to drive the active-surface signal; the
storybook stories leave it None so SSR snapshots stay
identical to the pre-callback baseline. Disabled items never
fire the callback.
Implementations§
Sourcepub fn builder() -> NavigationRailPropsBuilder<((), (), (), (), (), ())>
pub fn builder() -> NavigationRailPropsBuilder<((), (), (), (), (), ())>
Create a builder for building NavigationRailProps.
On the builder, call .items(...), .active(...), .workspace(...), .user(...)(optional), .workspace_open(...)(optional), .on_select(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of NavigationRailProps.
Trait Implementations§
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
§impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for Twhere
Request: Req<E> + Send + 'static,
Encoding: Decodes<T>,
E: FromServerFnError,
impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for Twhere
Request: Req<E> + Send + 'static,
Encoding: Decodes<T>,
E: FromServerFnError,
§impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for Twhere
Request: Req<E> + Send + 'static,
Encoding: Decodes<T>,
E: FromServerFnError,
impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for Twhere
Request: Req<E> + Send + 'static,
Encoding: Decodes<T>,
E: FromServerFnError,
§impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for Twhere
Request: Req<E> + Send + 'static,
Encoding: Decodes<T>,
E: FromServerFnError,
impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for Twhere
Request: Req<E> + Send + 'static,
Encoding: Decodes<T>,
E: FromServerFnError,
§impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for Twhere
Response: ClientRes<E> + Send,
Encoding: Decodes<T>,
E: FromServerFnError,
impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for Twhere
Response: ClientRes<E> + Send,
Encoding: Decodes<T>,
E: FromServerFnError,
§impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for Twhere
Response: ClientRes<E> + Send,
Encoding: Decodes<T>,
E: FromServerFnError,
impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for Twhere
Response: ClientRes<E> + Send,
Encoding: Decodes<T>,
E: FromServerFnError,
§impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for Twhere
Response: ClientRes<E> + Send,
Encoding: Decodes<T>,
E: FromServerFnError,
impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for Twhere
Response: ClientRes<E> + Send,
Encoding: Decodes<T>,
E: FromServerFnError,
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