Link

Theme-aware text links for navigation in content, tables, cards, and menus

Link

Link is a lightweight presentation primitive for native <a> elements. It keeps navigation semantic, wraps long text safely, and uses the active DuskMoon theme. Use a Button for actions such as saving or submitting.

@import "@duskmoon-dev/core/components/link";

The base class is underlined so links remain recognizable without relying on color alone.

Text link

Read the Link API reference before choosing a variant.

Hover underline

.link-hover starts without a visible underline, then restores it for both pointer hover and keyboard focus. Reserve it for contexts where surrounding navigation structure already makes the link affordance clear.

Underline on interaction

Colors

Primary is the default. Secondary and tertiary can distinguish nearby navigation choices. Neutral inherits the surrounding text color for restrained inline links; .link-inherit remains an equivalent spelling.

Theme colors

Composition

Link does not impose layout, so it composes with ordinary prose and existing components.

Card and long text

The same classes can be used on anchors in table cells, body copy, cards, Navbar, and Megamenu. Menu has its own item layout; add .link only when the text-link treatment is intentional.

States and accessibility

  • Hover, active, and :focus-visible states are supplied by CSS. Reduced-motion preferences remove the transition.
  • Keep meaningful link text. For icon-only links, provide an accessible name with aria-label or visually hidden text.
  • Do not use an anchor without href as a fake disabled link. Render non-actionable text, omit the unavailable destination, or let the application prevent navigation and expose an explanation. pointer-events: none alone does not prevent keyboard activation.
  • Navigation uses anchors. Actions use buttons.
  • The component does not announce external destinations automatically. Add clear text when opening another site or a new browsing context.

API reference

Class Purpose
.link Base underlined, wrapping text-link style
.link-hover Reveal the underline on hover and keyboard focus
.link-primary Primary theme color; also the base default
.link-secondary Secondary theme color
.link-tertiary Tertiary theme color
.link-neutral Inherit the surrounding text color
.link-inherit Compatibility alias for inherited color
  • Megamenu — grouped site navigation
  • Menu — inline lists and temporary popover surfaces
  • Button — actions rather than navigation