Link
Usage
Link is a text-level navigation control that moves users to another page, route, or destination. Use it for inline links, secondary navigation, and text-level actions where the destination should feel lightweight and text-like instead of button-like, and use the type prop when an internal or external destination should be signaled visually.
import { MtLink } from "@shopware-ag/meteor-component-library";
Examples
Critical
Disabled
External
Internal
API reference
Props
| Prop | Type | Default |
|---|---|---|
to | string | |
as | string | "router-link" |
variant | "critical" | "primary" | "primary" |
disabled | boolean | false |
type | "external" | "internal" |
Events
| Event | Payload |
|---|---|
click | [event: MouseEvent] |
Slots
| Slot | Bindings |
|---|---|
default | {} |
Best practices
Do
- Use link text that clearly describes the destination or result.
- Use the
typeprop when an internal or external destination should be signaled visually. - Keep Link close to the content or context it belongs to.
Don't
- Do not use Link for actions that stay on the current page.
- Do not use vague text such as
Click herewhen the destination matters. - Do not disable a link unless removing navigation is genuinely necessary.
Behavior
- Link can render different elements through the
asprop and defaults to arouter-link. variantchanges the visual emphasis, whiletypecan add an internal or external direction cue.disabledremoves the active destination and click behavior.
Accessibility
- Link text should make sense out of context so screen reader users can understand the destination.
- Use Link only when the control actually navigates somewhere.
- Make sure disabled links are used sparingly, since unavailable navigation can be confusing.
Related components
- Button: when the user should trigger an action on the current page.