Are you looking for a flexible solution to handle images in your React projects? Universal Image Component is here to simplify your image management, offering a range of modes to suit your needs. From Base64 conversion to CDN optimization, and more, this library is designed to make working with images effortless.
universal-img-component is a versatile React component that simplifies handling images in various modes, including Base64, CDN, text-based images, and Next.js optimization. Perfect for any project needing dynamic image handling!
Universal Image Component 📸
universal-img-component is a versatile React component that simplifies handling images in various modes, including Base64, CDN, text-based images, and Next.js optimization. Perfect for any project needing dynamic image handling!
Features ✨
Normal Mode: Display images using standard URLs.
Cloudinary Mode (Recommended): Use Cloudinary for image transformations and optimizations.
Base64 Mode: Convert images to Base64 format.
CDN Mode: Optimize images using a CDN service.
Text Mode: Create text-based images with Statically’s Open Graph service.
TextBase Mode: Convert text-based image URLs to Base64.
Next Mode: Use Next.js Image component for optimization (in a Next.js environment).
Installation 🚀
To get started, install the package via npm or yarn:
npm install universal-img-component
# or
yarn add universal-img-component
Base64 Conversion 🔄
Convert images to Base64 format directly in your application. This is useful for embedding images inline or when you need to ensure that images are included with your HTML or CSS.
CDN Optimization 🌐
Leverage the ImageCDN service to optimize and deliver images efficiently. This mode is ideal for improving performance and scalability, especially when handling a large number of images.
Text-Based Images 📝
Create dynamic images with custom text using the Statically service. This mode allows you to generate images on-the-fly with personalized text and styling options.
Use the Component:
Import and use the Img component in your React project with the mode of your choice.
Customize as Needed: Adjust props such as mode, format, fit, text, fontsize, and others to suit your project's requirements.
📈 Why Choose Universal Image Component?
Versatility: Handles various image modes and formats.
Simplicity: Easy to use with minimal configuration.
Performance: Optimizes image delivery and display.
Flexibility: Supports different projects, from standard React apps to Next.js applications.
🌟 Try It Out Today!
Upgrade your image handling with Universal Image Component and experience a new level of ease and efficiency. Check out our GitHub repository for more details, documentation, and to contribute!
Feel free to reach out to us at sh20raj@gmail.com for any questions or feedback. Happy coding! 🚀