A link is a navigational element that can be found on its own, within other text, or directly following content.
Preview
Usage
button and link (<a>) HTML elements each describe a specific intent. Understanding the distinction is important: if it goes somewhere, use a Link. If an action occurs, use a Button.
Do
- Use for navigating between destinations.
Don’t
- Use for actions, instead use a Button.
Best Practices
- Use useful, actionable, and descriptive text clearly conveying the hyperlink’s destination. For example, a generic label like "click here" doesn’t convey its target content.
- Too many links can be overwhelming. Be selective about the number of links in a context.
- Clearly identify links that target an external source.
Accessibility
- Allow keyboard navigation. Users must be able to navigate between links, i.e. keypress of tab, and activate it by pressing ‘Enter’.
- Users must be able to identify links without relying on color alone.
- Users must be able to activate hover and focus states with both a mouse and a keyboard.
Variants and Examples
Default
Inverted
Navigation
DtLink supports both external links and internal SPA navigation via Vue Router.
href
Use href for standard anchor links — external URLs, hash links, etc.
to
Use to for Vue Router navigation. DtLink renders as a <router-link> when to is provided.
Replace history
Use the replace prop to replace the current history entry instead of pushing a new one. Only applies when to is provided.