<a href> wrapper to enable navigation with client-side routing.
Type Declaration
Props
Can be a string or a partial Path object:
Replaces the current entry in the History stack instead of pushing a new one.
Adds persistent client side routing state to the next location.The location state is accessed from the
location:Prevents the scroll position from being reset to the top of the window when the link is clicked and the app is using ScrollRestoration.
Defines the relative path behavior for the link.
- route (default) - Resolves relative to the route pattern
- path - Resolves relative to the URL path
Will use document navigation instead of client side routing when the link is clicked.
Enables a View Transition for this navigation.To apply specific styles for the transition, see
useViewTransitionState.Defines the data and module prefetching behavior for the link.
- none (default) - No prefetching
- intent - Prefetches when the user hovers or focuses the link
- render - Prefetches when the link renders
- viewport - Prefetches when the link is in the viewport (useful for mobile)
Defines the link lazy route discovery behavior.
- render (default) - Discover the route when the link renders
- none - Don’t eagerly discover, only discover if the link is clicked
Masked path for this navigation. Navigates to one location but displays a different URL in the browser.
Examples
Basic Navigation
With Search Params
Dynamic Links
With State
Replace History
Prefetching
All HTML Attributes
SinceLink renders an <a> element, all standard anchor attributes are supported:
Notes
- Relative links are resolved relative to the route hierarchy by default
- External URLs are detected automatically and render as standard
<a>tags - Supports all standard
<a>HTML attributes - Progressive enhancement: works with JavaScript disabled if using proper forms