Link
Words you follow to another page: in a sentence, under a form, in a footer.

Plain Blade, pure CSS. No Alpine needed.
Use it
<p>By signing up you agree to the <x-ds::link :href="route('terms')">terms</x-ds::link>.</p>
<x-ds::link :href="route('sign-in')" variant="muted" size="sm">Use a different email</x-ds::link>
<x-ds::link href="https://status.example.com" external>Status page</x-ds::link>
Props
| Prop | Default | What it does |
|---|---|---|
href | required | Where it goes. Without one it throws: an action is a button. |
variant | default | default (the accent), muted (the body colour, for Terms and Privacy) or danger. |
size | — | Left out, the text size around it. sm or md for a link on its own. |
external | false | Opens in a new tab, with rel="noopener noreferrer", an arrow, and "(opens in a new tab)" for a screen reader. |
externalLabel | "(opens in a new tab)" | Those words, in your language. |
Other attributes go on the a.
Accessibility
- Underlined always, so it is not told apart by colour alone.
- Every variant is 4.5:1 on every surface, in both themes.
- The focus ring shows on keyboard focus.
- An external link says it opens a new tab.
Don't
- Don't make a button look like a link, or a link look like a button.
- Don't write
target="_blank"yourself; useexternal.
More in specs/link.md.
From the package repo: edit this page on GitHub.