1.0.5 • Published 8 months ago

image-optimizer-component v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

OptimizedImage Component Documentation

The image-optimizer-component package is used to display optimized images in your Next.js application. It provides support for both local and remote images.

Installation

To install the image-optimizer-component package, run the following command:

npm install image-optimizer-component@latest

Usage

Import the OptimizedImage component into your file as follows:

import OptimizedImage from 'image-optimizer-component'

export default function MyComponent() {
    return (
        <div>
            <h1>Welcome to My Component</h1>
            {/* Local image */}
            <OptimizedImage src="/path/to/image.jpg" alt="Image description" />
            {/* Remote image */}
            <OptimizedImage src="https://ejemplo.com/imagen.jpg" alt="Image description" />
        </div>
    )
}

Important

You must add the path of the host from which the remote images are obtained in the NextJs configuration file.

Props

The OptimizedImage component accepts the following props:

  • src (required): The source of the image. It can be a local path or a remote URL.

  • alt (optional): The alternative text for the image.

License

This project is licensed under the MIT License.

1.0.5

8 months ago

1.0.4

8 months ago

1.2.1

8 months ago

1.0.3

8 months ago

1.0.1

8 months ago