# router

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/router/

**module** · [`ferroui-view`](/docs/0.5.0/api/ferroui-view/) · v0.5.0

```rust
module router
```

Navigation between the views of a window ([`router`](/docs/0.5.0/api/ferroui-view/router/function-router/)), modelled on the
routing of ReactiveUI (`RoutingState`, `docs/mvvm.md`, section 7).

| ReactiveUI | Here |
|---|---|
| `RoutingState` | [`Router`](/docs/0.5.0/api/ferroui-view/router/struct-router/), provided by [`router`](/docs/0.5.0/api/ferroui-view/router/function-router/) to the components below |
| `NavigationStack` | `Router::stack`: the paths, the current one last |
| `Navigate` | `Router::navigate`: pushes a path |
| `NavigateBack` | `Router::navigate_back`: pops the current path |
| `NavigateAndReset` | `Router::navigate_and_reset`: the stack becomes the path alone |
| `CurrentViewModel` | `Router::current`: the current path |
| `RoutedViewHost` and the view locator | the routes: the view of the first pattern that matches |

The entries of the stack are paths rather than view models: a path names
its view and its parameters (`/people/42`), so the state of a screen that
outlives navigation lives in signals or contexts above the router, as the
view models of ReactiveUI live in the screen.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L1)

## Contents

- [`RouteMatch`](/docs/0.5.0/api/ferroui-view/router/struct-routematch/) — struct
- [`RouteDef`](/docs/0.5.0/api/ferroui-view/router/struct-routedef/) — struct
- [`route`](/docs/0.5.0/api/ferroui-view/router/function-route/) — function
- [`Router`](/docs/0.5.0/api/ferroui-view/router/struct-router/) — struct
- [`router`](/docs/0.5.0/api/ferroui-view/router/function-router/) — function
- [`use_router`](/docs/0.5.0/api/ferroui-view/router/function-use_router/) — function
- [`try_use_router`](/docs/0.5.0/api/ferroui-view/router/function-try_use_router/) — function

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
