How Do I Display Svg Icon With Lightning Components. In the first step we are create a small lightning component for rendered the SVG icons in our Lookup component. However if for whatever reason you did not want to use the lighting-button component or you wanted to display an SVG outside of a component you can display an SVG with the following LWC code.
Go to Lightning Component and it must be implemented with flexipageavailableForAllPageTypes. Go to Home Settings Edit Page. Create a new lightning component bundle with Name svg.
Hi Guys In my last post I showed how to use SVG Icon in Lightning Component.
File New Lightning Component Name your component. Export default class myComponent extends LightningElement svgURL SVG_LOGO logo Reference the field in your HTML template with the SVG use element. Read about usage and visual specifications for icons on the Iconography design guideline. A component can include an SVG resource to use as a custom icon in Lightning App Builder and Community Builder.