nerdexam
Salesforce

PDI · Question #74

Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers

The correct answer is A. $Lightning.createComponent D. $Lightning.use E. <apex:includeLightning/>. Embedding Lightning components on a Visualforce page requires including the Lightning Experience Stylesheets, initializing the Lightning app, and then programmatically creating the component.

Submitted by viktor_hu· Apr 18, 2026User Interface

Question

Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers

Options

How the community answered

(17 responses)
  • A
    94% (16)
  • B
    6% (1)

Why each option

Embedding Lightning components on a Visualforce page requires including the Lightning Experience Stylesheets, initializing the Lightning app, and then programmatically creating the component.

A$Lightning.createComponentCorrect

`$Lightning.createComponent` is the JavaScript function used to dynamically create an instance of a Lightning component and insert it into a specified DOM element on the Visualforce page.

B<apex:slds/>

`<apex:slds/>` is used to include the Salesforce Lightning Design System (SLDS) stylesheets in a Visualforce page, but it is not strictly required for embedding a Lightning component itself.

C$Lightning.useComponent

`$Lightning.useComponent` is not a standard or valid function in the Lightning Out framework for embedding components on Visualforce pages.

D$Lightning.useCorrect

`$Lightning.use()` is a JavaScript function that bootstraps the Lightning app framework on the Visualforce page, making Lightning components available for use. It typically specifies a Lightning dependency app.

E<apex:includeLightning/>Correct

`<apex:includeLightning/>` is a Visualforce component that injects the necessary JavaScript libraries and stylesheets to enable Lightning components within a Visualforce page.

Concept tested: Lightning Out for Visualforce

Source: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_out_visualforce.htm

Topics

#Lightning Out#Visualforce Integration#Lightning Components#UI Development

Community Discussion

No community discussion yet for this question.

Full PDI Practice