Display
External Link
A link that opens in a new tab with the right rel, an icon and a screen reader hint, ready for table cells.
<script>
import { ExternalLink } from "@codeatlasdev/ui";
</script>
<ExternalLink href="https://registrar.example/buy?d=atlas.dev">Buy at registrar</ExternalLink>
ExternalLink always sets target="_blank" with rel="noopener noreferrer", draws a trailing arrow icon (hidden from assistive technology) and appends a visually hidden “(opens in a new tab)” to the accessible name. The hint comes from the i18n catalog (externalLink.newTab), so it follows setLocale. Without it a screen reader user gets no warning that the link leaves the page.
A results table with a per-row external link needs nothing more than putting it in a cell. For links that look like buttons, use Button with href and target="_blank"; it already sets rel.
In a results table
One link per row. The accessible name of each link is for example “Buy at registrar (opens in a new tab)”.
| Domain | Price | Registrar |
|---|---|---|
| atlas.dev | $12.00 | Buy at registrar (opens in a new tab) |
| nimbus.io | $38.00 | Buy at registrar (opens in a new tab) |
| orbit.app | $21.00 | Buy at registrar (opens in a new tab) |
Reference #126 · Pick in the gallery
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | – | Destination URL. |
children | Snippet | – | Link text. |
showIcon | boolean | true | Trailing arrow icon. The screen reader hint stays either way. |
class | string | '' | Extra class names. |
Other anchor attributes (aria-label, data-*, onclick) are passed through. target and rel are fixed on purpose.