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
Usage π
Importing the Component
Import the Img
component:
import Img from 'universal-img-component';
Normal Mode πΌοΈ
Displays an image using the standard URL:
<Img src
β¦