Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Animations

Each hover treatment draws attention in its own way, so pick the one that suits the surrounding copy.

Hover treatments
Read the guideanimation="underline"
Read the guideanimation="underline-center"
Read the guideanimation="static"
Read the guideanimation="slide"
Read the guideanimation="icon"
Read the guideanimation="rotate"
Read the guideanimation="highlight"
Read the guideanimation="bracket"
Read the guideanimation="fade"
Read the guideanimation="grow"
Read the guideanimation="glow"
Read the guideanimation="shine"
Read the guideanimation="none"

Icons

Add a leading or trailing icon to show direction or a next step, not as decoration.

Leading and trailing icons
Show code
<app-link href="#" left-icon="download">Download the report</app-link>
<app-link href="#" right-icon="arrow-right">Next step</app-link>
<app-link href="#" animation="Icon">Learn more</app-link>

Sizes

Three sizes scale the text and icons together, so a link matches the copy around it.

Three sizes
Show code
<app-link href="#" size="Sm" right-icon="arrow-right">Small</app-link>
<app-link href="#" size="Md" right-icon="arrow-right">Medium</app-link>
<app-link href="#" size="Lg" right-icon="arrow-right">Large</app-link>

External and disabled

Use external for a link that leaves the site, and disabled when the link is not available yet.

External and disabled
Our site Unavailable
Show code
<app-link href="https://webority.dev" external="true" right-icon="external-link">Our site</app-link>
<app-link href="/x" disabled="true">Unavailable</app-link>

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.

On a dark panel
The panel is dark, so the link inside it sets surface to dark.
Read the guide surface=dark
Show code
<app-link href="/guide" surface="Dark" right-icon="arrow-right">Read the guide</app-link>

Every option

Every value of every prop, one cell each.

children (content)

(content): the link text

label

label: link text, wins over inner content

href

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

size="md" (default)

surface

surface="default" (default)
surface="dark"

external

external="false" (default)
external="true"

disabled

disabled="false" (default)
disabled="true"
Unavailable

linkComponent

linkComponent={...} (React only)

className

className="..." (React only)

maxLines (max-lines)

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

Do

One clear animation and a descriptive label. The link reads as a link and says where it goes.

Avoid

“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.

underline underline-center static slide icon rotate highlight bracket fade grow glow shine none
sm md lg
default dark
(none) arrow-right external-link download chevron-right star
(none) arrow-right external-link download chevron-right star
React, generated from the controls
<AppLink href="#">Read more</AppLink>
Razor, the same props
<app-link href="#">Read more</app-link>

11 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
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

PropTypeDefaultDescription
(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 pairs

Name the destination

Do

One clear animation and a descriptive label. The link reads as a link and says where it goes.

Avoid

“Click here” tells the reader nothing. Name the destination so the link explains where it goes.