Base components that are UI-based are built from Salesforce Lightning Design System (SLDS) design guidelines. While base components follow SLDS guidelines closely, they don’t implement every guideline or every feature on a design. You can also find subtle differences in attribute or variant names across base components and their associated SLDS guidelines.
Base components support SLDS 2 for advanced theming and branding capabilities.
Use base components where possible instead of creating your own component from an SLDS guideline. Using base components, you get the latest SLDS design updates automatically.
Note
Base components for LWC use the framework’s capabilities for a seamless integration with Salesforce data, making it easy for you to build dynamic and interactive apps. If a base component doesn’t support a feature that you see in an SLDS guideline, use the guideline to help you achieve your requirements.
Base components are not currently versioned. Most base components were first available in Spring ’19 (API version 45.0). To develop using LWC, set your custom component to use API version 45.0 or later in the component’s .js-meta.xml file. See Minimum API Version of Base Components.
Base components are in the lightning namespace and follow the format lightning-component-name in HTML markup, such as lightning-button-group, for example. Base components are grouped using these categories.
Actions and Menus
Containers
Images (Visuals)
Input
Forms
Navigation
Notifications
Output
Progress
Tables and Trees
Base components can compose another base component, such as lightning-button in lightning-button-group, or lightning-accordion-section in lightning-accordion. Base components also include utility modules that provide additional functionalities and utility methods.
Actions and Menus
Action and menu components trigger an action when clicked.
When implementing a nested card, lightning-card must be nested directly within lightning-card. Placing a datatable or tiles in a card requires your own customization.
Display content in the modal body. lightning-modal-body doesn’t allow customizing of the styling on the white modal frame and background, close button, or gray backdrop.
A file selector for uploading a file that’s associated with a record ID. To upload a file without a record ID, use lightning-input with type="file" instead.
Manages toast components by specifying the position and the maximum number that can be displayed.
58.0
Output
Output components display formatted data based on user locale and language. They don’t correspond to an SLDS design and can be used wherever data is displayed.
A table that displays rows and columns of data. To create striped rows on lightning-datatable, use the slds-table_striped class. lightning-datatable highlights a row on hover and doesn’t currently support slds-no-row-hover.
A table with rows of data that can be expanded or collapsed. Removing the borders on rows isn’t available for lightning-tree-grid.
45.0
Utility Modules
Utility modules provide additional functionalities and utility methods. They don’t correspond to an SLDS design. To use a module in your JavaScript file, import its functions from the module.
This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.