Edit this page

up.link up.link.config
Configuration object

Configures defaults for link handling.

In particular you can configure Unpoly to handle all links on the page without requiring developers to set [up-...] attributes.


config.followSelectors

An array of CSS selectors matching links that will be followed through Unpoly.

You can customize this property to automatically follow all links on a page without requiring an [up-follow] attribute. See Handling all links and forms.

Array<string>
config.noFollowSelectors

Exceptions to up.link.config.followSelectors.

Matching links will not be followed through Unpoly, even if they match up.link.config.followSelectors.

By default Unpoly excludes:

  • Links with an [up-follow=false] attribute. Also see boolean attributes.
  • Links with a [download] attribute.
  • Links with a [target] attribute (to target an iframe or open new browser tab).
  • Links with a javascript:, mailto: or tel: scheme.
  • Links with a cross-origin [href].
  • Links with an [href="#"] attribute that don't also have local HTML in an [up-document], [up-fragment] or [up-content] attribute.
  • Any additional exceptions configured in up.link.config.noFollowSelectors.
Array<string>

Instant click

config.instantSelectors

An array of CSS selectors matching elements that are activated on mousedown instead of on click.

You can customize this property to follow all links on mousedown without requiring an [up-instant] attribute. See Handling all links and forms.

Note that an instant link must also be followable, usually by giving it an [up-follow] attribute or by configuring up.link.config.followSelectors.

Array<string>
config.noInstantSelectors

Exceptions to up.link.config.instantSelectors.

Matching links will not be followed on mousedown, even if they match up.link.config.instantSelectors.

By default Unpoly excludes:

  • Elements with an [up-instant=false] attribute.
  • Links that are not followable.
Array<string>

Preloading

config.preloadSelectors

An array of CSS selectors matching links that are preloaded on hover.

You can customize this property to preload all links on mousedown without requiring an [up-preload] attribute. See Handling all links and forms.

Array<string>
config.noPreloadSelectors

Exceptions to up.link.config.preloadSelectors.

Matching links will not be preloaded on hover, even if they match up.link.config.preloadSelectors.

By default Unpoly excludes:

Array<string>
[config.preloadDelay=90]
optional

The number of milliseconds to wait before preloading on hover.

number

Interactive elements

[config.clickableSelectors]
optional

A list of CSS selectors matching elements that should behave like links or buttons.

See Clicking on non-interactive elements.

Array<string>
[config.noClickableSelectors]
optional

Exceptions to up.link.config.clickableSelectors.

Matching elements will not be receive interactive behavior, even if they match up.link.config.clickableSelectors.

Array<string>