When to use
- Page navigation
- Inline references
- Related resources
- External destinations
Links move users to another destination. Use them for navigation, references, and related resources; use buttons when the interface performs an action.
Start here before choosing examples or props. These notes explain where Link helps, where another pattern is better, and what should stay true in product work.
import { Link } from '@/components/ui/Link';Renders Next.js Link for internal paths; native anchor for external and in-page hrefs.
Links should make the destination predictable. The style can change by placement, but the behavior should always be navigation.
Review the vendor setup guide before submitting the request.
Use links inside body copy when the destination is part of the sentence.
Use a standalone link when navigation is useful but not the primary page action.
Use a document icon only when it helps identify the destination type.
Show when a link opens an outside destination or leaves the product context.
Use anchored links for nearby page movement, not for submitting or changing data.
Use row links for repeated destinations where the entire row is the target.
A link is more than colored text. It needs a destination, readable wording, a visible affordance, and a focus state that works without pointer input.
The component accepts every native HTMLAnchorElement attribute on top of the design system props below.
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | — | Destination. Internal paths render Next.js Link; external, mailto, and anchor (#) hrefs render a native anchor. |
variant | 'inline' | 'standalone' | 'resource' | 'external' | 'anchor' | 'row' | 'inline' | Placement and emphasis. Behavior is always navigation; the variant changes affordance only. |
leadingIcon | ReactNode | — | Icon rendered before the label, e.g., a document glyph for related-resource links. |
trailingIcon | ReactNode | — | Icon rendered after the label, e.g., an arrow for standalone or an external icon for external links. |
Links move users to another page, section, document, or external destination.
Submitting, saving, deleting, opening dialogs, and changing state should use Button instead.
Write link text that tells users where they will go. The destination should be clear out of context.
Avoid generic labels like click here, learn more, or read this when the destination can be named.
What Link does not do yet, and what consumers need to compose themselves.
Agents should choose Link only when the user is moving somewhere. If the UI changes state, submits data, or opens a dialog, generate a Button instead.
import { Link } from '@/components/ui/Link';
import { ExternalLink } from 'lucide-react';
<Link href="/vendors/active" variant="standalone">
Active vendors
</Link>
<Link
href="https://example.com/policy"
variant="external"
trailingIcon={<ExternalLink size={16} aria-hidden="true" />}
>
Policy library
</Link>Links navigate. Buttons act. When generated UI is ambiguous, decide by behavior before deciding by appearance.