useLink

Provides the behavior and accessibility implementation for a link component. A link allows a user to navigate to another page or resource within a web page or application.

Example
Link.tsx
Link.css
import {Link} from './Link';

<Link href="https://adobe.com" target="_blank">Adobe</Link>

API

useLink(props: , ref: <FocusableElementnull>):

AriaLinkOptions

NameTypeDefault
isDisabledbooleanDefault:

Whether the link is disabled.

elementTypestringDefault: 'a'

The HTML element used to render the link, e.g. 'a', or 'span'.

LinkAria

NameType
linkPropsDOMAttributes

Props for the link element.

isPressedboolean

Whether the link is currently pressed.