Link
A link allows a user to navigate to another page or resource within a web page or application.
Effective Practices
When using links, consider the following best practices:
- Use clear link wording.
- Don’t repeat the URL as part of the link text.
- Don’t say “link” or “links to” in the link text.
- Keep your link text as short as possible.
- Minimize instances where multiple copies of the same text are linked to different places, such as “Click here”.
Usage Guidelines
Use clear messaging to create links that fit your needs and guide your users.
We’ve provided some examples to get you started.
Example
Learn more about butterflies (opens in a new window)
<Link href="https://en.wikipedia.org/wiki/Butterfly" rel="noopener noreferrer nofollow" target="_blank"> Learn more about butterflies (opens in a new window)</Link>Weather (opens in a this window)
<Link href="https://www.weather.com">Weather (opens in a this window)</Link>Effective practices (navigates to another location within the page)
<Link href="#effective-practices"> Effective practices (navigates to another location within the page)</Link>Props
Whether the link is disabled.
Handler that is called when the press is released over the target.
Handler that is called when a press interaction starts.
Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.
Handler that is called when the press state changes.
Handler that is called when a press is released over the target, regardless of whether it started on the target or not.
Not recommended – use onPress instead. onClick is an alias for onPress
provided for compatibility with other libraries. onPress provides
additional event details for non-mouse interactions.
Whether the element should receive focus on render.
Handler that is called when the element receives focus.
Handler that is called when the element loses focus.
Handler that is called when the element's focus status changes.
Handler that is called when a key is pressed.
Handler that is called when a key is released.
A URL to link to. See MDN.
Hints at the human language of the linked URL. SeeMDN.
The target window for the link. See MDN.
The relationship between the linked resource and the current page. See MDN.
Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN.
A space-separated list of URLs to ping when the link is followed. See MDN.
How much of the referrer to send when following the link. See MDN.
Options for the configured client side router.
Handler that is called when a hover interaction starts.
Handler that is called when a hover interaction ends.
Handler that is called when the hover state changes.
The children of the component. A function may be provided to alter the children based on component state.
The CSS className for the element. A function may be provided to compute the class based on component state.
The inline style for the element. A function may be provided to compute the style based on component state.
A slot name for the component. Slots allow the component to receive props from a parent component.
An explicit null value indicates that the local props completely override all props received from a parent.