SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

LinkHost

The site an outbound link goes to, shown as its host with an arrow out.

View code
tsx
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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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

tsx
<LinkHost href={post.url} variant="chip" />
tsx
<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

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

Other components this module publishes.

  • linkHost
@sdxc/ui

Can’t find it? Contact us