Makes any element behave like a hyperlink.
The following <span>
element will navigate to /details
when clicked:
<span up-href="/details">Read more</span>
To make the link-like element as accessible as possible, it gains the following behaviors:
[role=link]
attribute so screen readers announce it as link.pointer
cursor when hovered over.up:click
event when activated.[up-instant]
attribute to make the element
activate on mousedown
instead of click
.The link-like element cannot be opened in a new tab.
<a>
elementsIn general you should prefer using regular hyperlinks (a[href]
) over elements with [up-href]
:
<a>
elements are also exceptional in that they may contain block elements.
[up-href]
There are some use cases for [up-href]
:
<a>
, e.g. a <tr>
.Info
All attributes for
a[up-follow]
may be used.
The URL to load when activated.