Atomic Angular — Doc interne

Link

Style a native anchor as a navigation link, internal or external, while keeping every native and router semantic intact.

Link styles a native <a> as a navigation link while keeping every native and router semantic intact — href, routerLink, target, aria-current, and so on. Hover, active and focus rely on native pseudo-classes; the current-page and disabled looks react directly to the aria-current="page" and aria-disabled attributes, however they got set.

Minimal example

How it works

Link never touches aria-current itself — its styling only reacts to the attribute being present, however it got there. That is what lets Angular Router own it entirely:

host attribute openWindow=true attr.target / attr.rel sets matched by CVA selector Consumer "a[link external-link icon (auto, linkIconRight) new tab/window Angular Router (routerLink + routerLinkActive) aria-current=page

Recipes

Router integration

Let routerLinkActive + [ariaCurrentWhenActive]="'page'" drive the current-page look — this is the supported way, not comparing the current URL by hand.

openWindow fully owns target/rel — the same way disabled owns aria-disabled/tabindex — and appends the external-link icon automatically. Don't set target/rel manually on a link that binds it, and don't use it if a custom rel is needed (use a manual link-icon-right in that case instead).

<a link [openWindow]="true" href="https://docs.sinequa.com">Read the docs</a>

Options

Prop

Type

Pitfalls

What's next

On this page