A LinkButton combines the functionality of a link with the appearance of a button. Useful for allowing users to navigate to another page.
API
<LinkButton>
<Icon />
<Text />
</LinkButton>
LinkButton
| Name | Type | Default |
|---|---|---|
children | ReactNode | Default: — |
The content to display in the Button. | ||
isDisabled | boolean | Default: — |
Whether the link is disabled. | ||
styles | StylesProp | Default: — |
Spectrum-defined styles, returned by the | ||
variant | 'primary'
| 'secondary'
| 'accent'
| 'negative'
| 'premium'
| 'genai' | Default: 'primary'
|
The visual style of the button. | ||
fillStyle | 'fill' | 'outline' | Default: 'fill'
|
The background style of the Button. | ||
size | 'S'
| 'M'
| 'L'
| 'XL' | Default: 'M'
|
The size of the Button. | ||
staticColor | 'white'
| 'black'
| 'auto' | Default: — |
The static color style to apply. Useful when the Button appears over a color background. | ||
onPress | | Default: — |
Handler that is called when the press is released over the target. | ||
onPressStart | | Default: — |
Handler that is called when a press interaction starts. | ||
onPressEnd | | Default: — |
Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. | ||
onPressChange | | Default: — |
Handler that is called when the press state changes. | ||
onPressUp | | Default: — |
Handler that is called when a press is released over the target, regardless of whether it started on the target or not. | ||
onFocus | | Default: — |
Handler that is called when the element receives focus. | ||
onBlur | | Default: — |
Handler that is called when the element loses focus. | ||
onFocusChange | | Default: — |
Handler that is called when the element's focus status changes. | ||
onKeyDown | | Default: — |
Handler that is called when a key is pressed. | ||
onKeyUp | | Default: — |
Handler that is called when a key is released. | ||
onHoverStart | | Default: — |
Handler that is called when a hover interaction starts. | ||
onHoverEnd | | Default: — |
Handler that is called when a hover interaction ends. | ||
onHoverChange | | Default: — |
Handler that is called when the hover state changes. | ||
href | Href | Default: — |
A URL to link to. See MDN. | ||
hrefLang | string | Default: — |
Hints at the human language of the linked URL. SeeMDN. | ||
target | HTMLAttributeAnchorTarget | Default: — |
The target window for the link. See MDN. | ||
rel | string | Default: — |
The relationship between the linked resource and the current page. See MDN. | ||
download | boolean | string | Default: — |
Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN. | ||
ping | string | Default: — |
A space-separated list of URLs to ping when the link is followed. See MDN. | ||
referrerPolicy | HTMLAttributeReferrerPolicy | Default: — |
How much of the referrer to send when following the link. See MDN. | ||
routerOptions | RouterOptions | Default: — |
Options for the configured client side router. | ||
autoFocus | boolean | Default: — |
Whether the element should receive focus on render. | ||
id | string | Default: — |
The element's unique identifier. See MDN. | ||
aria-current | boolean
| 'true'
| 'false'
| 'page'
| 'step'
| 'location'
| 'date'
| 'time' | Default: — |
Indicates whether this element represents the current item within a container or set of related elements. | ||
aria-label | string | Default: — |
Defines a string value that labels the current element. | ||
aria-labelledby | string | Default: — |
Identifies the element (or elements) that labels the current element. | ||
aria-describedby | string | Default: — |
Identifies the element (or elements) that describes the object. | ||
aria-details | string | Default: — |
Identifies the element (or elements) that provide a detailed, extended description for the object. | ||
UNSAFE_className | UnsafeClassName | Default: — |
Sets the CSS className
for the element. Only use as a last resort. Use the | ||
UNSAFE_style | CSSProperties | Default: — |
Sets inline style for the
element. Only use as a last resort. Use the | ||
slot | string | null | Default: — |
A slot name for the component. Slots allow the component to receive props from a parent
component. An explicit | ||