Modules Support

Lightning web component modules in the lightning namespace are described in the Component Reference in the Lightning Web Components Developer Guide. Modules scoped with @salesforce are described in @salesforce Modules in the Lightning Web Components Developer Guide. All modules are being reviewed for correct behavior in LWC Offline-enabled mobile apps.

The following table presents current findings.

  • SupportedSupported. Expected to behave as documented.
  • Limited SupportLimited Support. Can be used, but has known (and possibly unknown) issues.
  • Not SupportedNot Supported. Might work, but shouldn’t be used.
ModuleStatusComments
lightning Namespace Modules These modules contain resources that don’t change and are universal to all orgs.  
lightning/alert Create an alert modal within your component.Supported 
lightning/confirm Create a confirm modal within your component.Supported 
lightning/empApi Provides methods for subscribing to a streaming channel and listening to event messages.Not SupportedNot supported in mobile apps.
lightning/flowSupport Provides events to control flow navigation and notify the flow of changes in attribute values.Not Supported 
lightning/messageService Communicates across the DOM between Visualforce pages, Aura components, and Lightning web components.Not SupportedLightning Aura components and Visualforce aren’t supported in the Field Service mobile app. This isn’t expected to change.
lightning/navigation Generates a URL or navigates to a page reference.Limited SupportAvailable for use, but supported page reference types are limited. See Navigation for details.
lightning/pageReferenceUtils Provides utilities for encoding and decoding default field values.Not SupportedNot supported in mobile apps.
lightning/platformResourceLoader Imports a third-party JavaScript or CSS library.Limited SupportNot supported for offline use.
lightning/platformShowToastEvent Displays toasts to provide feedback to a user following an action, such as after a record is created.Not SupportedYou can import this module and fire toast events. However, toast messages aren’t handled or displayed. Use lightning/alert, lightning/confirm, or lightning/prompt instead.
lightning/prompt Create a prompt modal within your component.Supported 
lightning/userConsentCookie Utility functions to incorporate the Cookie Consent mechanism in your components.Not SupportedRelevant only for Experience Builder pages.
@salesforce Scoped Modules The shape of these modules can be dynamic, defined by your organization’s metadata.  
@salesforce/apex Import Apex methods as functions that a component can call either via @wire or imperatively.Limited SupportSee Use Apex While Mobile and Offline for usage details.
@salesforce/apexContinuation Import methods from Apex continuation classes.Limited SupportSee Use Apex While Mobile and Offline for usage details.
@salesforce/client/formFactor Import a name that refers to the form factor of the hardware running the app.Limited SupportThis module “works,” but always returns Small when used in an LWC Offline-enabled app.
@salesforce/community Import the ID of the current Experience Builder site.Not SupportedRelevant only for Experience Builder pages.
@salesforce/contentAssetUrl Import content asset files.Limited Support 
@salesforce/i18n Import internationalization properties.Supported 
@salesforce/label Import labels defined in your Salesforce organization.Supported 
@salesforce/messageChannel Import a Lightning message channel that a component can use to communicate via the Lightning Message Service.Not SupportedLightning Message Service isn’t supported in LWC Offline-enabled mobile apps.
@salesforce/resourceUrl Import static resources defined in your Salesforce organization.Supported 
@salesforce/schema Import references to Salesforce objects and fields defined in your org.Supported 
@salesforce/user Import the current user’s ID.Supported 
@salesforce/userPermission Import a permission and check whether it’s assigned to the current user.Supported 
@salesforce/customPermission Import a custom permission and check whether it’s assigned to the current user.Supported 

See Also