Coming from Orbiter, you should be aware of the following changes:
Link
,IconLink
andTextLink
have all been merged into one.LinkAsButton
has been removed. It is now possible to use theLink
component without anhref
attribute.
A link allows a user to navigate to a different location.
A Link
uses the following components:
Links can be disabled.
An external text link will render by default with rel="noopener noreferrer"
and target="_blank"
attributes.
When a <Link>
does not have an href prop, it is rendered as a <span role="link">
instead of an <a>
. Events will need to be handled in JavaScript with the onPress
prop.
Note: this will not behave like a native link. Browser features like context menus and open in a new tab will not apply.
Links can be presented in different variants.
Links can be presented in different sizes.
The size can also be inherited.
Links can contain an icon.
Non standard start icons can be provided to handle special cases. However, think twice before adding start icons, end icons should be your go to.
A link's content can be a single icon. When using this variant, an accessible name must be provided through the aria-label
prop. See WCAG practices.
All links can have a quiet style, without an underline. This style should only be used when the placement and context of the link is explicit enough that a visible underline isnโt necessary.
All links can have a standalone style, without an underline which is similar to quiet, the difference is this adds block padding to make it more similar to a button.
A button can be rendered as a react router link when using the href
property and setting the navigate property on the HopperProvider
When the colors from the variant props are not enough, you can use the color
prop to set the color of the link. This removes the hover and focus colors from the link. Use the color props when a link needs to be placed on top of a colored background or visual. Make sure that the background and the link color meet the minimum color contrast ratio.
A link's content can be an image element.
The visual style of the link.
Size of the link.
Whether the link should be displayed with a quiet style.
Whether the link should open in a new tab.
Wheter the link is standalone
The inline style for the element. A function may be provided to compute the style based on component state.
Whether the link is disabled.
Whether the element should receive focus on render.
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.
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.
Sets the background-color
property.
If you want to use a token value from the SCALE, use the backgroundColor
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the background-color
property when active.
If you want to use a token value from the SCALE, use the backgroundColorActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the background-color
property when focused.
If you want to use a token value from the SCALE, use the backgroundColorFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the background-color
property when hovered.
If you want to use a token value from the SCALE, use the backgroundColorHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border
property.
If you want to use a token value from the SCALE, use the border
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border
property when active.
If you want to use a token value from the SCALE, use the borderActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-bottom
property.
If you want to use a token value from the SCALE, use the borderBottom
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-bottom
property when active.
If you want to use a token value from the SCALE, use the borderBottomActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-bottom
property when focused.
If you want to use a token value from the SCALE, use the borderBottomFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-bottom
property when hovered.
If you want to use a token value from the SCALE, use the borderBottomHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-bottom-left-radius
property.
If you want to use a token value from the SCALE, use the borderBottomLeftRadius
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-bottom-right-radius
property.
If you want to use a token value from the SCALE, use the borderBottomRightRadius
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border
property when focused.
If you want to use a token value from the SCALE, use the borderFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border
property when hovered.
If you want to use a token value from the SCALE, use the borderHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-left
property.
If you want to use a token value from the SCALE, use the borderLeft
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-left
property when active.
If you want to use a token value from the SCALE, use the borderLeftActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-left
property when focused.
If you want to use a token value from the SCALE, use the borderLeftFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-left
property when hovered.
If you want to use a token value from the SCALE, use the borderLeftHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-radius
property.
If you want to use a token value from the SCALE, use the borderRadius
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-right
property.
If you want to use a token value from the SCALE, use the borderRight
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-right
property when active.
If you want to use a token value from the SCALE, use the borderRightActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-right
property when focused.
If you want to use a token value from the SCALE, use the borderRightFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-right
property when hovered.
If you want to use a token value from the SCALE, use the borderRightHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-top
property.
If you want to use a token value from the SCALE, use the borderTop
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-top
property when active.
If you want to use a token value from the SCALE, use the borderTopActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-top
property when focused.
If you want to use a token value from the SCALE, use the borderTopFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-top
property when hovered.
If you want to use a token value from the SCALE, use the borderTopHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-top-left-radius
property.
If you want to use a token value from the SCALE, use the borderTopLeftRadius
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the border-top-right-radius
property.
If you want to use a token value from the SCALE, use the borderTopRightRadius
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the box-shadow
property.
If you want to use a token value from the SCALE, use the boxShadow
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the box-shadow
property when active.
If you want to use a token value from the SCALE, use the boxShadowActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the box-shadow
property when focused.
If you want to use a token value from the SCALE, use the boxShadowFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the box-shadow
property when hovered.
If you want to use a token value from the SCALE, use the boxShadowHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the color
property.
If you want to use a token value from the SCALE, use the color
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the color
property when active.
If you want to use a token value from the SCALE, use the colorActive
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the color
property when focused.
If you want to use a token value from the SCALE, use the colorFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the color
property when hovered.
If you want to use a token value from the SCALE, use the colorHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the column-gap
property.
If you want to use a token value from the SCALE, use the columnGap
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the fill
property.
If you want to use a token value from the SCALE, use the fill
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the fill
property when focused.
If you want to use a token value from the SCALE, use the fillFocus
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the fill
property when hovered.
If you want to use a token value from the SCALE, use the fillHover
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the font-family
property.
If you want to use a token value from the SCALE, use the fontFamily
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the font-size
property.
If you want to use a token value from the SCALE, use the fontSize
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the font-weight
property.
If you want to use a token value from the SCALE, use the fontWeight
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the gap
property.
If you want to use a token value from the SCALE, use the gap
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the grid-auto-columns
property.
If you want to use a token value from the SCALE, use the gridAutoColumns
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the grid-auto-rows
property.
If you want to use a token value from the SCALE, use the gridAutoRows
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the grid-column-span
property.
If you want to use a token value from the SCALE, use the gridColumnSpan
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the grid-row-span
property.
If you want to use a token value from the SCALE, use the gridRowSpan
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the grid-template-columns
property.
If you want to use a token value from the SCALE, use the gridTemplateColumns
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the grid-template-rows
property.
If you want to use a token value from the SCALE, use the gridTemplateRows
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the height
property.
If you want to use a token value from the SCALE, use the height
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the line-height
property.
If you want to use a token value from the SCALE, use the lineHeight
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the margin
property.
If you want to use a token value from the SCALE, use the margin
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the margin-bottom
property.
If you want to use a token value from the SCALE, use the marginBottom
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the margin-left
property.
If you want to use a token value from the SCALE, use the marginLeft
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the margin-right
property.
If you want to use a token value from the SCALE, use the marginRight
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the margin-top
property.
If you want to use a token value from the SCALE, use the marginTop
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the horizontal margin (margin-left
and margin-right
) property.
If you want to use a token value from the SCALE, use the marginX
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the vertical margin (margin-top
and margin-bottom
) property.
If you want to use a token value from the SCALE, use the marginY
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the max-height
property.
If you want to use a token value from the SCALE, use the maxHeight
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the max-width
property.
If you want to use a token value from the SCALE, use the maxWidth
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the min-height
property.
If you want to use a token value from the SCALE, use the minHeight
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the min-width
property.
If you want to use a token value from the SCALE, use the minWidth
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the padding
property.
If you want to use a token value from the SCALE, use the padding
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the padding-bottom
property.
If you want to use a token value from the SCALE, use the paddingBottom
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the padding-left
property.
If you want to use a token value from the SCALE, use the paddingLeft
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the padding-right
property.
If you want to use a token value from the SCALE, use the paddingRight
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the padding-top
property.
If you want to use a token value from the SCALE, use the paddingTop
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the horizontal padding (padding-left
and padding-right
) property.
If you want to use a token value from the SCALE, use the paddingX
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the vertical padding (padding-top
and padding-bottom
) property.
If you want to use a token value from the SCALE, use the paddingY
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the row-gap
property.
If you want to use a token value from the SCALE, use the rowGap
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the stroke
property.
If you want to use a token value from the SCALE, use the stroke
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
Sets the width
property.
If you want to use a token value from the SCALE, use the width
property instead.
This property is marked as UNSAFE because you're opting out of the intended values of the design system.
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.
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.
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.
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.
Defines a string value that labels the current element.
Identifies the element (or elements) that labels the current element.
Identifies the element (or elements) that describes the object.
Identifies the element (or elements) that provide a detailed, extended description for the object.
Coming from Orbiter, you should be aware of the following changes:
Link
, IconLink
and TextLink
have all been merged into one.LinkAsButton
has been removed. It is now possible to use the Link
component without an href
attribute.