Inline link primitive with default/muted/underline/arrow/external variants, asChild router support and safe external handling.
Design intent
Every codebase re-implements inline links with inconsistent variants and unsafe target=_blank. Link centralizes the variants, keeps a real <a href> (SEO, modified clicks) and adds rel=noopener plus a screen-reader note for external URLs.
npx @slipstream-ui/cli@latest add linkDefault: read the docs · muted: changelog · underline: privacy
Arrow: browse components →
External (auto): GitHub(opens in a new tab)
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| href | string | — | Destination URL (or pass it on the asChild element). |
| variant | 'default' | 'muted' | 'underline' | 'arrow' | 'external' | 'default' | Visual style. |
| asChild | boolean | false | Render the child (router Link) with link styling. |
| external | boolean | — | Force external handling. Absolute http(s) URLs are auto-detected; mailto/tel never open a new tab. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't use Link for buttons
Actions belong in Button; Link is for navigation.
tsx// Avoid<Link href="#" onClick={save}>Save</Link>// Prefer<Button onClick={save}>Save</Button>
Accessibility
- Renders a real <a href>, so middle-click and modified clicks behave like the platform.
- External links get rel="noopener noreferrer" and an sr-only “opens in a new tab” note.
- Focus ring is visible on keyboard focus.
Content guidelines
Link text
- Describe the destination
- 2-5 words
Good examples
- Read the docs
- View on GitHub
Bad examples
- Click here
Composition
Compose with Card / List: asChild makes whole-card links safe
<Card asChild><Link href="/post">…</Link></Card>
Related components: Button, Breadcrumb, Card
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
- @radix-ui/react-slot
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.