Link
An underlined link. External links open safely and say so.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsstable
- 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
| Prop | Type | Default | Description |
|---|---|---|---|
external | boolean | – | Opens in a new tab with `rel="noopener noreferrer"` and announces that. |
asChild | boolean | – | 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
| Class | Stylesheet |
|---|---|
.divider | 09-links.css |
.link | 09-links.css |
.skip-link | 09-links.css |
.link | link.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)".