Salesforce Lightning Design System (SLDS) Patterns - MCP Knowledge

Based on Real Implementation Experience: These patterns align official SLDS guidance with real-world LWC and Experience Cloud implementations.

Overview

Salesforce Lightning Design System (SLDS) provides design tokens, component blueprints, and UX guidelines for building consistent experiences across Salesforce. This document distills key patterns for:

Prerequisites

When to Use SLDS Patterns

Use This When

Avoid This When

Core Concepts

Component-First Design

Design Tokens and Utility Classes

Responsive Layouts

Patterns and Examples

Pattern 1: Page Layout with Grid System

Pattern 2: Form Layout with SLDS

Edge Cases and Limitations

Q&A

Q: Why should I use SLDS instead of custom CSS frameworks?

A: SLDS ensures visual consistency, accessibility, and maintainability across Salesforce apps. It integrates tightly with Lightning base components and is supported by Salesforce UX updates, reducing design drift.

Q: How do design tokens help with theming?

A: Design tokens abstract colors, spacing, and typography into semantic values. Changing a token updates all components that use it, enabling consistent theming without touching component code.