Linkv0.4.4Ready for Production
An accessible anchor component with configurable underline behavior, text wrapping, disabled state, and polymorphic rendering via asChild. Built on standard HTML with Catalyst design tokens.
Prefer AI-assisted development?
Catalyst Link wraps the standard HTML <a> element with built-in design tokens, CVA variants for underline and wrap control, and a disabled state — giving you a production-ready link with zero configuration.
Installation
npm install @pmi/catalyst-linkimport { Link } from '@pmi/catalyst-link';Variants
Underline Options
Controls when the underline decoration appears. Four values are available:
auto— underline on hover (default). Clean at rest.always— permanently underlined. Best for body text where link affordance must be clear.hover— underline on hover only, identical toautoin most contexts.none— no underline. Use when context or styling already communicates interactivity.
Disabled
Sizes
Common Patterns
Truncated Text
Wrap Options
API Reference
Prop
Type
Accessibility
Link is designed to meet WCAG 2.2 AA standards.
Keyboard Interactions
| Key | Action |
|---|---|
Tab | Moves focus to an enabled link |
Enter | Activates the focused enabled link and navigates |
Disabled links have no href, so they are skipped by Tab by default and cannot be activated. A tabIndex={0} passed to a disabled link keeps it in sequential focus navigation, so avoid it unless the link must stay focusable.
ARIA attributes
- Uses the native
<a>element, providing built-in link semantics for assistive technologies. - When
disabledis set,hrefis removed andpointer-events-noneis applied. Because HTML does not provide a native disabled state for links, consider rendering non-interactive text instead when navigation is unavailable. - For external links, always pair
target="_blank"withrel="noopener noreferrer"to prevent reverse tabnapping and avoid leaking the opener reference. - Use
asChildwith<NextLink>or React Router's<Link>to preserve native link semantics while enabling client-side navigation.
Additional Accessibility Guidance
Contrast and Appearance
- Default text colors (
pmi-off-black-800/white) meet the 4.5:1 minimum. Verify contrast when applying customclassNameoverrides. - Links should not be identified by color alone. Ensure non-color visual cues such as underlines, font styling, or other indicators distinguish links from surrounding text.
- Enabled links show an inset
focus-visiblering and border by default (pmi-off-black-800in light mode,whitein dark mode). Keep a visible focus indicator when overriding styles. - Use
underlinevalues consistently across your site so links are predictably identified by visual style.
Link Purpose and Icon - only links
- Provide descriptive link text; avoid generic labels like "Click Here", "Learn More", "View All".
- Require an accessible name through visible text,
aria-label, oraria-labelledby. - Decorative icons within links should be hidden from assistive technologies using aria-hidden="true" unless they convey meaningful information.
New Window Notification: (Best Practice)
- Inform users when a link opens a new tab or window, especially if the behavior is unexpected.
Choosing the Right Component
Use Link when you need to navigate to a URL. Reach for a different primitive when:
| If you need… | Use instead |
|---|---|
| An action that doesn't navigate (submit, open modal, toggle state) | Button |