Salesforce Lightning Design System (SLDS) 2 (Beta)


NSIQ Icon
September 25, 2025

salesforce lightning design system two

Overview

The Salesforce Lightning Design System (SLDS) 2 is a modern CSS framework designed to produce harmonious, accessible, and responsive user interfaces for Salesforce applications and external web projects. Built with mobile-first principles and WCAG 2.1 compliance, SLDS 2 provides a robust set of components, utility classes, and design tokens to streamline development while ensuring a polished user experience aligned with Salesforce’s Lightning Experience.

This document covers setup, key components, advanced usage, accessibility, integration tips, troubleshooting, and best practices for leveraging SLDS 2 effectively.

Installation and Setup

SLDS 2 can be integrated into Salesforce Lightning components or standalone web applications.

Via CDN

Include SLDS 2 using the official CDN:

Via CDN

Local Download

Download the SLDS package from lightningdesignsystem.com and host it locally:

Local Download

In Salesforce

SLDS 2 is natively available in Lightning Web Components (LWC) and Aura components. Wrap your markup in the slds-scope class:

In Salesforce

For LWC, import if needed:

Import SLDS assets

Core Components

SLDS 2 offers a wide range of pre-styled components. Below are detailed examples of commonly used components.

Buttons

SLDS 2 provides various button styles for different use cases:

Buttons

Grid System

The responsive grid system supports flexible layouts:

Grid System

Cards

Cards organize content in a structured, visually appealing way:

Cards

Modals

Modals are used for focused interactions:

Modals

Data Tables

Display tabular data with sorting and selection:

Data Tables

Utility Classes

SLDS 2’s utility-first approach simplifies styling:

  • Spacing: slds-m-top_small, slds-p-around_large
  • Typography: slds-text-heading_medium, slds-text-color_success
  • Alignment: slds-text-align_right, slds-float_left
  • Visibility: slds-hide, slds-show_medium

Example:

Utility Classes

Design Tokens

SLDS 2 uses design tokens for consistent theming (e.g., colors, fonts, sizes). Example:

Design Tokens

Refer to the SLDS Tokens documentation for a full list.

Accessibility

SLDS 2 is designed for WCAG 2.1 compliance:

  • ARIA Attributes: Use aria-label, aria-describedby, and aria-hidden as needed.
  • Keyboard Navigation: Ensure all interactive elements are focusable with tabindex.
  • Color Contrast: Verify contrast ratios meet accessibility standards.
  • Testing Tools: Use WAVE, axe, or Salesforce’s Accessibility Toolkit.

Example for accessible buttons:

Accessibility

Integration with Salesforce

Lightning Web Components (LWC)

Use SLDS 2 in LWC by applying classes directly:

Lightning Web Components (LWC)

Aura Components

Apply SLDS classes in Aura markup:

Aura Components

External Applications

For non-Salesforce apps, include SLDS 2 via CDN or local files and use the slds-scope class. Ensure icons are accessible by including the SLDS sprite assets:

External Applications

Advanced Usage

Customizing Components

Override SLDS styles cautiously using custom CSS or design tokens:

Customizing Components

Dynamic Components

Use JavaScript to toggle SLDS classes for dynamic behavior:

Dynamic Components

Responsive Design

Leverage SLDS responsive classes:

Responsive Design

Troubleshooting

  • Styles Not Applied: Ensure slds-scope is used and the CSS file is correctly loaded.
  • Icon Issues: Verify the sprite path is correct (e.g., /assets/icons/…).
  • Accessibility Errors: Check ARIA attributes and test with screen readers like NVDA or VoiceOver.
  • Responsive Breakpoints: Use slds-show_* and slds-hide_* classes for device-specific visibility.

Best Practices

  1. Adhere to SLDS Patterns: Follow component blueprints to maintain consistency.
  2. Minimize Custom CSS: Use utility classes to reduce maintenance overhead.
  3. Optimize Performance: Include only required SLDS modules via scoped imports or CSS purging.
  4. Test Across Devices: Validate responsiveness using browser dev tools or real devices.
  5. Monitor Updates: Check SLDS Release Notes for new features and bug fixes.
  6. Document Customizations: Maintain a style guide for any custom SLDS modifications.

Resources

  • Official Site: Salesforce Lightning Design System
  • Component Library: SLDS Components
  • Accessibility Guide: SLDS Accessibility
  • Icons: SLDS Icons
  • Community: Salesforce Developer Community

Conclusion

SLDS 2 is a versatile framework for building modern, accessible, and responsive interfaces. Its extensive component library, utility classes, and design tokens make it ideal for Salesforce developers and external web projects. By following this documentation, you can leverage SLDS 2 to create consistent, high-quality applications efficiently.

For further assistance, explore the official SLDS resources or engage with the Salesforce developer community. Whether you’re building custom Lightning apps internally or collaborating with a Salesforce consultant in USA, SLDS 2 ensures a consistent, user-friendly experience aligned with Salesforce’s Lightning standards.