On this page
@addTagHelper *, Webority.Ui.RazorAnimations
Each hover treatment draws attention in its own way, so pick the one that suits the surrounding copy.
Icons
Add a leading or trailing icon to show direction or a next step, not as decoration.
Sizes
Three sizes scale the text and icons together, so a link matches the copy around it.
External and disabled
Use external for a link that leaves the site, and disabled when the link is not available yet.
On a dark panel
Set the surface to dark on a link that sits on a dark hero or footer, so the text keeps its contrast.
Every option
Every value of every prop, one cell each.
children (content)
(content): the link textlabel
label: link text, wins over inner contenthref
href="#every-option"animation
animation="underline" (default)animation="underline-center"animation="static"animation="slide"animation="icon"animation="rotate"animation="highlight"animation="bracket"animation="fade"animation="grow"animation="glow"animation="shine"animation="none"leftIcon (left-icon)
left-icon="download"rightIcon (right-icon)
right-icon="arrow-right"size
surface
surface="default" (default)surface="dark"external
external="false" (default)external="true"disabled
disabled="false" (default)disabled="true"linkComponent
linkComponent={...} (React only)className
className="..." (React only)maxLines (max-lines)
max-lines: omitted (default)Guidance
What to do, and what to avoid.
Use it when
- An inline prose link inside body copy.
- A footer link or a 'read more' / 'learn more' affordance.
- A marketing call-to-action link where the hover should feel deliberate.
Reach for something else when
- The control performs an action rather than navigating. → AppButton
- It is a primary navigation item in the app chrome. → AppShell
- It is a rich link card with an icon tile and supporting text. → AppResourceCard
- It is the trail to the current page. → AppBreadcrumbs
Name the destination
One clear animation and a descriptive label. The link reads as a link and says where it goes.
“Click here” tells the reader nothing. Name the destination so the link explains where it goes.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
11 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| hrefdefault - | string | - | The destination, or the to path when a link component is given. Left out, the anchor has no href. |
| left-icondefault - | string | - | The leading glyph: an icon name or a node. |
| right-icondefault - | string | - | The trailing glyph: an icon name or a node. |
| sizedefault md | sm | md | lg | md | The text and icon size. |
| labeldefault - | string | - | Link text; inner content is used when absent. |
Less common 6 props
| Prop | Type | Default | Description |
|---|---|---|---|
| (content)default - | string | - | The link text (inner content, or the label attribute). |
| animationdefault underline | underline | underline-center | static | slide | icon | rotate | highlight | bracket | fade | grow | glow | shine | none | underline | The hover treatment: underline slides a line in from the left, underline-center grows it from the middle, static is an always-visible underline with no motion, slide nudges the label and icons right, icon slides a trailing icon in (an arrow when none is given), rotate turns the trailing icon a quarter-eighth turn (45 degrees) on hover and focus (an up-right arrow when none is given), highlight wipes a tinted background across, bracket slides brackets in around the label, fade shifts colour only, grow opens up the letter spacing, glow adds a soft glow, shine sweeps a light shimmer across the label, and none is a plain coloured link. |
| surfacedefault default | default | dark | default | Set dark when the link sits on a dark panel such as a dark hero or footer; the text turns light. |
| externaldefault false | bool | false | Opens the link in a new tab, with the matching target and rel. |
| disableddefault false | bool | false | Renders the link as unavailable: no navigation, and aria-disabled is set. |
| max-linesdefault - | int | - | Clamps the label to this many lines, ending the last one with an ellipsis. Omit it for a label that runs on. Whole numbers of 1 or more only. |
Screen reader
3 notes- A disabled link renders as a plain span with aria-disabled set and no href, so it is neither focusable nor announced as a link.
- An external link opens in a new tab with rel noopener noreferrer.
- Every animation is disabled under prefers-reduced-motion: reduce, where the link degrades to a static underline.
Do and avoid
1 pairsName the destination
One clear animation and a descriptive label. The link reads as a link and says where it goes.
“Click here” tells the reader nothing. Name the destination so the link explains where it goes.