SalesforceSalesforce
PDI · Question #152
PDI Question #152: Real Exam Question with Answer & Explanation
The correct answer is A: Upload the SVG as a static resource.. To include a custom SVG in a Lightning Web Component, a developer must upload the SVG as a static resource, import it into the JavaScript file, and then reference it via a getter in the HTML template.
Submitted by dimitri_ru· Apr 18, 2026User Interface
Question
Which three steps allow a custom SVG to be included in a Lightning web component? Choose 3 answers
Options
- AUpload the SVG as a static resource.
- BImport the static resource and provide a getter for it in JavaScript.
- CReference the getter in the HTML template.
- DReference the import in the HTML template.
- EImport the SVG as a content asset file.
Explanation
To include a custom SVG in a Lightning Web Component, a developer must upload the SVG as a static resource, import it into the JavaScript file, and then reference it via a getter in the HTML template.
Common mistakes.
- D. The HTML template references a JavaScript getter or property that holds the imported static resource's URL, not the direct import statement itself.
- E. While content asset files exist, the standard and most direct method for including custom SVG images for use within Lightning Web Components is by uploading them as static resources.
Concept tested. Using static resources for custom SVGs in LWC
Topics
#Lightning Web Components#Static Resources#SVG#UI Development
Community Discussion
No community discussion yet for this question.