Playground

Link

An underlined link. External links open safely and say so.

  • Built on native elements
  • A real anchor with a visible underline; focus ring shared with other controls.
  • External links get rel="noopener noreferrer" and a hidden "(opens in a new tab)".
  • Styles in one file: 09-links.css

Import

import '@monoline/css';
import {Link} from '@monoline/react';

Not installed yet? Pick a route.

Copies the source and its styles into your project.

npx monoline add link

Usage

import {Link} from '@monoline/react';

<p>Read the <Link href="#button">button docs</Link> or visit <Link href="https://github.com" external>GitHub</Link>.</p>

Examples

Internal and external

Props

LinkProps

PropTypeDefaultDescription
externalboolean–Opens in a new tab with `rel="noopener noreferrer"` and announces that.
asChildboolean–Use the child (a router link) instead of an anchor.

Data Attributes

State is exposed through attributes. Style it with these selectors, not with class toggles.

This component sets no state attributes.

CSS classes

ClassStylesheet
.divider09-links.css
.link09-links.css
.skip-link09-links.css
.linklink.css

Customization

Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.

app.css
.divider {
  border-color: var(--accent);
}

Accessibility

  • A real anchor with a visible underline; focus ring shared with other controls.
  • External links get rel="noopener noreferrer" and a hidden "(opens in a new tab)".