LinkHost
The site an outbound link goes to, shown as its host with an arrow out.
View code
import { LinkHost } from "@sdxc/ui/blog";
<LinkHost href="https://www.example.com/notes/on-caching" />
<LinkHost href="https://docs.example.org/guide" variant="chip" />
<LinkHost href="https://www.example.com/notes/on-caching">Visit example.com</LinkHost>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { LinkHost } from "@sdxc/ui/blog";Renders an <a> to the outbound address reading its host and an arrow out, opened with
rel="noreferrer" unless the caller sets its own rel. The arrow is decorative, so the
link's accessible name is the host, or the children that replace it.
Examples
<LinkHost href={post.url} variant="chip" /><LinkHost href={post.url}>Visit {linkHost(post.url)}</LinkHost>Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
Types
| Name | Values | What it decides |
|---|---|---|
Variant | "plain" | "chip" | plain sets the host as small muted text; chip draws it in a hairline pill in the monospace face, to stand beside a title. |
Also exported
Other components this module publishes.
linkHost