Salesforce Lightning Design System (SLDS) is a comprehensive set of guidelines and resources provided by Salesforce for designing and building user interfaces that are visually appealing and consistent with the Salesforce Lightning Experience. SLDS provides a framework of reusable components, cascading style sheets (CSS), and design tokens that make it easy to create responsive, accessible, and beautiful user interfaces. In this blog, we will explore some of the most commonly used SLDS examples that can help you enhance your Salesforce Lightning applications.
Buttons and Icons:
Buttons and icons are essential elements of any user interface. SLDS provides a wide range of button styles and icons that you can use to create intuitive and interactive user experiences. For example, you can use the SLDS button styles like “slds-button”, “slds-button_neutral”, or “slds-button_brand” to create different types of buttons with varying colors and styles. Additionally, you can leverage the SLDS icon library to include meaningful icons alongside your buttons for improved usability.
Buttons :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SLDS offers a responsive grid system that allows you to create consistent layouts for your Salesforce Lightning applications. The grid system is based on a 12-column layout, making it easy to divide the screen into multiple sections. You can use SLDS classes like “slds-grid” and “slds-col” to create responsive grids that adapt to different screen sizes and orientations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cards are commonly used to display information or groups of related data in a visually appealing manner. SLDS provides a card component that allows you to present content in a structured and organized way. With SLDS, you can easily create cards with headers, titles, bodies, footers, and various styling options. You can customize the card’s appearance by using SLDS classes such as “slds-card” and “slds-card__header”.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modals and popovers are useful components for displaying additional information or performing specific actions without navigating away from the current page. SLDS offers modal and popover components that can be easily integrated into your Salesforce Lightning applications. By using SLDS classes like “slds-modal” and “slds-popover”, you can create overlay-based UI elements that enhance user interactions.
Modals :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modals and popovers are useful components for displaying additional information or performing specific actions without navigating away from the current page. SLDS offers modal and popover components that can be easily integrated into your Salesforce Lightning applications. By using SLDS classes like "slds-modal" and "slds-popover", you can create overlay-based UI elements that enhance user interactions.
</p>
<p>
Modals and popovers are useful components for displaying additional information or performing specific actions without navigating away from the current page. SLDS offers modal and popover components that can be easily integrated into your Salesforce Lightning applications. By using SLDS classes like "slds-modal" and "slds-popover", you can create overlay-based UI elements that enhance user interactions.
</p>
</div>
<div class="slds-modal__footer">
<button class="slds-button slds-button_neutral" aria-label="Cancel and close">Cancel</button>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Forms and input fields are crucial components for collecting user data and enabling data entry. SLDS provides a set of styling classes that allow you to create consistent and visually appealing forms. Whether it’s checkboxes, radio buttons, picklists, or text fields, SLDS offers comprehensive guidelines for designing and aligning form elements in a user-friendly manner.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Data tables are frequently used to present large sets of data in a tabular format. SLDS provides styling guidelines and classes to create responsive and accessible data tables. You can easily customize the appearance of the tables, apply sorting, filtering, and pagination features, and ensure that the tables are accessible to users with disabilities.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Badges and labels are small visual elements that provide additional information or context to users. SLDS offers classes for creating badges and labels with different colors and styles.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Toast notifications are non-intrusive messages that provide feedback or alerts to users. SLDS provides classes for creating toast notifications with various styles and icons.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tabs are a common UI element used to organize content into multiple sections. SLDS provides classes for creating tab navigation with different styles and layouts.
Vertical Tabs :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spinner is a visual component used in Salesforce Lightning to indicate that a process or action is in progress. It consists of a rotating animation with a circular shape. The spinner is commonly used to provide feedback to users while a task is being executed or when data is being loaded. Its purpose is to enhance the user experience by conveying that the system is working on a task and to prevent users from perceiving delays as errors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Salesforce Lightning Design System (SLDS) offers a wide range of components and styles to build visually appealing and user-friendly interfaces. In this blog, we explored ten commonly used SLDS examples, including buttons and icons, the grid system, cards, modals and popovers, forms and input fields, data tables, badges and labels, toast notifications, tabs, and progress indicators. By utilizing these examples and adhering to SLDS best practices, you can create cohesive and engaging experiences within your Salesforce Lightning applications.