CSA Lightning Components 2 — Questions and Answers
Question 1: Which Lightning component attribute type would you use to pass a collection of records from a parent component to a child component?
- String
- Object
- List (Correct answer)
- Map
Correct answer: List
The List type is used to pass collections of records or values between Lightning components.
Question 2: In Lightning App Builder, which property controls whether a component appears on desktop but not mobile?
- Device Visibility
- Form Factor (Correct answer)
- Display Mode
- Component Width
Correct answer: Form Factor
Form Factor in Lightning App Builder determines whether a component displays on desktop, phone, or both.
Question 3: What happens when a user navigates away from a Lightning component that uses the lightning:navigation mixin?
- The component is destroyed and recreated on return (Correct answer)
- Component state is preserved automatically
- A confirmation dialog appears
- The component is hidden but not destroyed
Correct answer: The component is destroyed and recreated on return
When navigating away, Lightning components are destroyed; state is not automatically preserved unless explicitly managed.
Question 4: Which base Lightning component would you use to display a modal dialog in a Lightning Web Component?
- lightning-overlay
- lightning-modal (Correct answer)
- lightning-dialog
- lightning-popup
Correct answer: lightning-modal
lightning-modal is the base component used to display modal dialogs in Lightning Web Components.
Question 5: What is the purpose of the 'targets' property in a Lightning Web Component's metadata file?
- Specifies which users can access the component
- Defines where the component can be used in Salesforce (Correct answer)
- Lists external API endpoints the component calls
- Sets the component's default styling
Correct answer: Defines where the component can be used in Salesforce
The 'targets' property in the .js-meta.xml file specifies which Salesforce contexts (App Builder, Flow, etc.) can use the component.
Question 6: Which utility bar feature can be configured using a Lightning component in App Builder?
- Pinned sidebar items
- Persistent panels at the bottom of the app (Correct answer)
- Floating action buttons
- Tab navigation headers
Correct answer: Persistent panels at the bottom of the app
The utility bar hosts Lightning components as persistent panels at the bottom of a Lightning app, accessible to users at all times.
Question 7: When configuring a Lightning component for the App Builder, which file must be present to make the component available?
- .json configuration file
- .css style file
- .js-meta.xml metadata file (Correct answer)
- .html template file only
Correct answer: .js-meta.xml metadata file
The .js-meta.xml metadata file must be present and properly configured to expose a Lightning Web Component in App Builder.
Which Lightning component attribute type would you use to pass a collection of records from a parent component to a child component?