Navigation Route

Represents a Material UI-styled navigation route for transitioning between views.

Overview

The NavigationRoute view creates a navigational link that wraps a destination view in a MaterialUI-styled navigation container.

To use NavigationRoute, initialize it with a destination view and a label view.

Initializer

Creates a navigation route with the specified destination and label.

NavigationRoute(destination: @escaping () -> Destination, label: @escaping () -> Label)

Parameters

Parameter
Description

destination

The view to navigate to, wrapped in a Material UI-styled container.

label

The view that serves as the trigger for navigation, styled according to Material UI.

Example

NavigationRoute {
    Container {
        Text("Profile View")
    }
} label: {
    NavigationRouteLabel(systemImage: "arrowshape.turn.up.right.fill", "Navigation Route")
}

Last updated