Edit this page

up.link [up-clickable]
HTML selector

This feature is experimental. It may be changed or removed in a future version.

Enables keyboard interaction for elements that represent links or buttons.

To define the element's effect when activated, handle the up:click event. If you want Unpoly to treat this element like a hyperlink, set an [up-href] attribute.

Accessibility

When the element is not an <a> or <button>, it gains the following behaviors to make it more accessible:

  • The element is given an [role=link] attribute so screen readers announce it as link.
  • The element shows pointer cursor when hovered over.
  • The element can be focused with the keyboard.
  • The element emits an up:click event when activated.
  • You may also assign an [up-instant] attribute to make the element activate on mousedown instead of click.

Unobtrusive use

To add these behaviors to existing elements without setting the [up-clickable], push a selector into up.link.config.clickableSelectors.