Link - National Design System

Styled links for embedding references, calls to action, and external destinations within body text, alert messages, and content areas.

Color Variants

Choose a color palette that matches the link's visual context. Neutral is the default for most content; primary draws attention to key calls to action.

For complete policy details, review the official guidelines before submitting your application.

On-Color

Use the on-color variant when placing links on primary or brand-colored backgrounds to ensure sufficient contrast.

Explore available programs and register your organization today.

External Links

Links to a different domain are detected and marked with the external icon automatically. Use nds-icon to add an inline link icon to internal links. Apply data-no-external to any link or ancestor to opt out of automatic external treatment.

Consult the Saudi Open Data portal for published datasets.

Review the ITU accessibility guidelines before publishing your service.

Icon Link

Download the Accessibility Compliance Report for the current quarter.

Opt-out

This partner portal skips external treatment on a single link.

All links in this container are also excluded: trusted site and related service.

Built-in Features

Auto-initialization

Runs on every page at load time. No selector required, no manual call needed.

Color Variants

Neutral, primary, and on-color palettes with hover and active states driven by design tokens.

External Link Detection

Compares each link's hostname against the current page origin and marks cross-domain links with the external icon automatically.

Safe Navigation

External links open in a new tab automatically. Cross-domain links also receive rel="noopener noreferrer". Subdomain links are treated as trusted and skip the rel attribute.

Opt-out Control

Add data-no-external to any link or ancestor element to prevent automatic external treatment on that link or the entire container.

Underline Modifier

Add nds-underline to reinforce link identity in dense text where color alone may not be sufficient.

Usage Guidelines

Best Practices

  • Use nds-link on <a> elements for inline text links within paragraphs, alert messages, card footers, and other content areas
  • Use nds-primary for calls to action embedded in body text where the primary color signals importance, such as "Learn more" or "Apply now" links
  • Use nds-oncolor when placing links on primary or dark backgrounds. Neutral and primary variants do not have sufficient contrast on colored surfaces
  • Add nds-underline in dense reading content where adjacent text without underlines could make links hard to distinguish from surrounding copy
  • Add nds-neutral on links inside .nds-content-section nds-demo-section if you need them to stay neutral. By default, all links in a content section use the primary color
  • Do not use nds-link on standalone navigation items. Use Breadcrumb, Side Navigation, or Tabs for navigation structure
  • Do not use a link when an action is intended rather than navigation. Use nds-btn nds-subtle for text-like interactive controls that trigger behavior
  • External links (different domain) are detected and marked automatically. You do not need to add target="_blank" or rel="noopener noreferrer" manually for cross-domain URLs
  • Use data-no-external on a link or a wrapper element when you want to suppress the external icon and new-tab behavior, such as for trusted partner sites or embedded widgets from a known domain
  • Icon-only buttons (nds-btn nds-icon-only) that happen to be links are automatically excluded from external treatment since they have no visible label to accompany the external icon

Modifier Classes

ClassDescription
nds-primaryPrimary color palette: uses the brand color for default, hover, and active states
nds-colorAlias for nds-primary
nds-oncolorOn-color palette for links placed on dark or branded backgrounds
nds-neutralExplicitly neutral color. Use inside .nds-content-section nds-demo-section to opt out of the primary default
nds-underlineAdds underline decoration to reinforce link identity in dense text
nds-iconShows a generic link icon after the text. Use for internal links that benefit from a visual anchor cue
nds-externalShows the external-link icon after the text. Applied automatically by JS to cross-domain links

Data Attributes

AttributeDescription
data-no-externalPlace on an <a> or any ancestor element. Links matching or contained within the element skip external detection: no nds-external class, no target="_blank", no rel

CSS Custom Properties

PropertyDefaultDescription
--link-color--link-neutralText color in the default state. Set on the element or an ancestor to override the variant
--link-hover--link-neutral-hoveredText color on hover
--link-pressed--link-neutral-pressedText color on active press
--link-focused--link-neutral-focusedText color when focused
--link-visited--link-neutral-visitedText color for visited links. Active inside .nds-content-section where the :visited state is applied

JavaScript API

NDS.Link runs automatically at page load. Call NDS.Link.init() after injecting link elements dynamically to apply external-link detection to the new markup.

// Runs automatically on page load. No manual call needed. // After inserting links dynamically, call init() to process the new elements: NDS.Link.init();
Was this page useful?
60% of users said Yes from 2843 Feedbacks