Beta Preview

Link

A link allows a user to navigate to another page or resource within a web page or application.

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

<Link
  href="https://www.imdb.com/title/tt6348138/"
  target="_blank">
  The missing link
</Link>

Events

Links with an href will be handled by the browser, or via a client side router. Links without an href will be rendered as a <span role="link"> instead of an <a>. Use the onPress event to handle user interaction.

Link
import {Link} from './Link';

<Link onPress={() => alert('Pressed link')}>Link</Link>

API

NameType
isDisabledboolean
Whether the link is disabled.
children<>
The children of the component. A function may be provided to alter the children based on component state.

Default className: react-aria-Link

Render PropCSS Selector
isCurrentCSS Selector: [data-current]
Whether the link is the current item within a list.
isHoveredCSS Selector: [data-hovered]
Whether the link is currently hovered with a mouse.
isPressedCSS Selector: [data-pressed]
Whether the link is currently in a pressed state.
isFocusedCSS Selector: [data-focused]
Whether the link is focused, either via a mouse or keyboard.
isFocusVisibleCSS Selector: [data-focus-visible]
Whether the link is keyboard focused.
isDisabledCSS Selector: [data-disabled]
Whether the link is disabled.