Crate yew_nav_link

source ·
Expand description

The nav_link module provides a NavLink component and related types for creating navigational links that are aware of their active state based on the current route in the application.

§Example

use yew-nav-link::{nav_link, NavLink};
    <!-- Creating a NavLink for the Home route with the text "Home Page" -->
    <li class="nav-item">
        { nav_link(HomeRoute::IntroPage, "Home") }
    </li>
    <!-- or -->
    <li class="nav-item">
        <NavLink<HomeRoute> to={HomeRoute::IntroPage}>
            {"Home"}
        </NavLink<HomeRoute>>
    </li>

Structs§

  • NavLink component for Yew applications using Yew Router.
  • Props for NavLink component. R: Routable - A trait bound to ensure that this component can only be used with routable types.

Functions§

  • Creates a NavLink component for the specified route with the provided children.