Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class Path(val path: String, val parameters: Parameters?)
Link copied to clipboard

Use the DSL functions to build the expected route handled by a Router. If two routes match the same path, the first declared route is chosen.

Link copied to clipboard
interface Router
Link copied to clipboard
annotation class Routing

Functions

Link copied to clipboard
@Composable
fun BrowserRouter(initPath: String, routeBuilder: @Composable RouteBuilder.() -> Unit)

A router leveraging the History API (https://developer.mozilla.org/en-US/docs/Web/API/History).

Link copied to clipboard
@Composable
fun HashRouter(initPath: String, routeBuilder: @Composable RouteBuilder.() -> Unit)

This Router implementation uses /#/path to persistent the current route in window.location.hash.

Link copied to clipboard
fun Router.navigate(to: String, parameters: Parameters, hide: Boolean = false, replace: Boolean = false)
fun Router.navigate(to: String, parameters: Map<String, String>, hide: Boolean = false, replace: Boolean = false)
fun Router.navigate(to: String, parameters: Map<String, List<String>>, hide: Boolean = false, replace: Boolean = false)
Link copied to clipboard
@Composable
fun Router.route(initRoute: String, routing: @Composable RouteBuilder.() -> Unit)