Navigation API
Declared by <huxerui/navigation.h>.
Navigation chrome
Section titled “Navigation chrome”TopAppBar,TopAppBarTitleAlignment,TopAppBarStyle.NavigationItem: label/icon constructors,SelectedIcon, andEnabled.NavigationBarandNavigationPane: controlled selected index andOnChanged.NavigationBarStyleandNavigationPaneStyleconfigure colors, icon/label geometry, selection indicator, indication, and animation.
Drawers
Section titled “Drawers”StartDrawerandEndDrawer: content, controlledOpen, andOnOpenChanged.DrawerLayout: content-only, either-side, and both-side constructors.DrawerStyle: surface/scrim/shadow, preferred/minimum widths, minimum content width, modal reveal, edge drag width, corner radius, and optional motion.DrawerMotion: open and close animation specs.
Factory navigation
Section titled “Factory navigation”NavigationStack(factory, args...) creates a retained stack. NavigationController exposes Push, Pop, Replace, CanPop, and Depth; factory/argument overloads avoid forwarding lambdas. UseNavigation() resolves the nearest stack and UseRootNavigation() the outermost.
Routed navigation
Section titled “Routed navigation”NavigationPath<Route> stores route values and exposes Empty, Size, Routes, and equality. NavigationStack(root, State<NavigationPath<Route>>, resolver) builds destinations. RouteNavigationController<Route> exposes Push, Pop, Replace, SetPath, CanPop, and Depth. Typed UseNavigation<Route>() and UseRootNavigation<Route>() require a compatible routed stack.
Motion
Section titled “Motion”PageTransition has push, pop, and replace TransitionSpec values. Attach it to a page root with With; it overrides the entire inherited NavigationStyle::motion policy. Push/replace select the incoming page’s policy; pop selects the departing page’s. The selected policy is fixed for that operation.
A default NavigationStyle has no motion; Default() supplies generic slides. An absent motion disables inherited animation unless a page declares its own PageTransition. PageTransition explicitly makes all operations immediate. Page interaction is disabled during an operation, while container Back and predictive cancellation remain available. See Animation.
See the dedicated navigation component pages and routing guide.
Complete typed-route example
Section titled “Complete typed-route example”#include <huxerui/huxerui.h>
using namespace huxerui;
struct ArticleRoute { int id = 0; bool operator==(const ArticleRoute&) const = default;};
View Article(const ArticleRoute& route) { return Text::Format("Article {}", route.id);}
View Home() { auto navigation = UseNavigation<ArticleRoute>(); return Button("Open article").OnClick([navigation] { navigation.Push(ArticleRoute {.id = 42}); });}
[[huxerui::composable]]View RoutedApplication() { auto path = UseState(NavigationPath<ArticleRoute>{}); return NavigationStack(Home, path, Article);}The path is application-owned state; the controller performs typed mutations and the resolver maps each route value to a destination View.

