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
Example
Link.tsx
Link.css
Example
Link.tsx
Link.css
import {Link} from './Link';
<Link href="https://adobe.com" target="_blank">Adobe</Link>
API
useLink (props: AriaLinkOptions, ref: RefObject <FocusableElement | null > ): LinkAria
AriaLinkOptions
| Name | Type | Default |
|---|---|---|
isDisabled | boolean | Default: — |
Whether the link is disabled. | ||
elementType | string | Default: 'a'
|
The HTML element used to render the link, e.g. 'a', or 'span'. | ||
LinkAria
| Name | Type | |
|---|---|---|
linkProps | DOMAttributes | |
Props for the link element. | ||
isPressed | boolean | |
Whether the link is currently pressed. | ||