function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mathew Thomas 29Mathew Thomas 29 

how would I add an image I have to an already existing LWC(In my case its a slider)

Best Answer chosen by Mathew Thomas 29
Mathew Thomas 29Mathew Thomas 29
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_resources
This shows how to take a static resource(This would be a file,image etc) onto a lightning web component. In my case I had a slider on which I wanted a image below it. Using this link it can help

All Answers

AbhishekAbhishek (Salesforce Developers) 
https://salesforce.stackexchange.com/questions/278296/how-can-i-dynamically-load-a-static-resource-image-in-lwc

This answers your query.


If it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
Mathew Thomas 29Mathew Thomas 29
@abhishek
As I am new at developing in salesforce I had a query regarding how would I also add that image to static resources
 
Dushyant SonwarDushyant Sonwar
Mattherw, i guess you are talking about lightning:Carousel
https://developer.salesforce.com/docs/component-library/bundle/lightning-carousel/example

You need to add lightning-carousel-image tag where you can specify the src (Source url of the image).
 
Mathew Thomas 29Mathew Thomas 29
@dushyant actually no I want to upload a custom image I have on my desktop so how would I do that using static resources 
Mathew Thomas 29Mathew Thomas 29
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_resources
This shows how to take a static resource(This would be a file,image etc) onto a lightning web component. In my case I had a slider on which I wanted a image below it. Using this link it can help
This was selected as the best answer