Last updated: Dec-11-2024
On this page:
Overview
Learn how to optimize images in SolidJS using the Cloudinary js-url-gen library.
Video tutorial
View the code
You can find the code from this tutorial in GitHub.Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Use Cloudinary to deliver images in SolidJS
0:00 | SolidJS is designed for speed, and it's crucial that your images load just as quickly. Learn how to utilize Cloudinary's URL-Gen SDK to set up, optimize, and transform images in SolidJS. |
Use the Cloudinary URL-Gen SDK in SolidJS
0:17 | The Cloudinary URL-Gen SDK is versatile and can be integrated into any JavaScript app or framework. To use it with SolidJS, install the SDK, import it into your project, and then set up a new Cloudinary instance. Begin transforming Cloudinary URLs by updating your existing image src prop to {cld.image(<public id>).toURL()} . |
Apply Cloudinary optimizations
1:12 | Optimize your images by chaining the quality option with the value "auto" for Automatic Quality Selection. Then, chain the format option, also set to "auto," for Automatic Format Selection. |
Add image transformations
1:56 | Enhance your image optimization by adding transformations. Import the scale action and chain the resize transformation to set the image width to 1200px and height to 800px. You can take this a step further by utilizing Cloudinary's Responsive Images solution. |
Keep learning
Related topics
- Learn more about image optimization.
- Learn more about image transformations.
- Watch more Dev Hints videos on the Cloudinary YouTube channel.
If you like this, you might also like...
Optimization Tips
Tips for delivering optimized imagesOptimize Images with Nuxt
Optimize images in Nuxt with Nuxt CloudinaryContent-aware Video Cropping
Smartly crop a video using content-aware AI
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
✖️