Framework
Version

LinkOptions type

The LinkOptions type extends the NavigateOptions type and contains additional options that can be used by TanStack Router when handling actual anchor element attributes.

tsx
type LinkOptions = NavigateOptions & {
  target?: HTMLAnchorElement['target']
  activeOptions?: ActiveOptions
  preload?: false | 'intent'
  preloadDelay?: number
  disabled?: boolean
}
type LinkOptions = NavigateOptions & {
  target?: HTMLAnchorElement['target']
  activeOptions?: ActiveOptions
  preload?: false | 'intent'
  preloadDelay?: number
  disabled?: boolean
}

LinkOptions properties

The LinkOptions object accepts/contains the following properties:

target

  • Type: HTMLAnchorElement['target']
  • Optional
  • The standard anchor tag target attribute

activeOptions

  • Type: ActiveOptions
  • Optional
  • The options that will be used to determine if the link is active

preload

  • Type: false | 'intent' | 'viewport' | 'render'
  • Optional
  • If set, the link's preloading strategy will be set to this value.
  • See the Preloading guide for more information.

preloadDelay

  • Type: number
  • Optional
  • Delay intent preloading by this many milliseconds. If the intent exits before this delay, the preload will be cancelled.

disabled

  • Type: boolean
  • Optional
  • If true, will render the link without the href attribute
Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.