Link
Type-safe navigation components and utilities for creating links in TanStack Router.LinkOptions
Configuration options for link navigation.string
required
The destination path. Can be absolute or relative.
string
The source path for type inference. Enables better autocomplete.
Record<string, any>
Path parameters for the destination route.
Record<string, any> | (prev) => Record<string, any>
Search parameters for the destination route. Can be an object or updater function.
string | (prev) => string
URL hash for the destination.
any | (prev) => any
History state for the navigation.
boolean
Replace current history entry instead of pushing a new one.Default:
falseboolean
Reset scroll position when navigating.Default:
trueboolean
Wrap navigation in React.startTransition.Default:
falseboolean | ViewTransitionOptions
Use View Transition API for navigation animation.
false | 'intent' | 'viewport' | 'render'
When to preload the destination route:
false- Don’t preload'intent'- Preload on hover/focus'viewport'- Preload when in viewport'render'- Preload immediately
number
Delay in milliseconds before preloading.Default:
50boolean
Disable the link navigation.Default:
falsestring
Standard anchor target attribute (
_blank, _self, etc.).ActiveOptions
Options for determining when the link is active.
React.AnchorHTMLAttributes
Props to apply when the link is active.
React.AnchorHTMLAttributes
Props to apply when the link is inactive.
ActiveOptions
Options for determining link active state.boolean
Match the path exactly.Default:
falseboolean
Include hash in active matching.Default:
falseboolean
Include search params in active matching.Default:
false