1.0.4 • Published 2 years ago

@delicious-simplicity/next-image-contentful-loader v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@delicious-simplicity/next-image-contentful-loader

A comprehensive Contentful image loader for the Next.js Image component.

Features

  • Allows for native Contentful image params/options
  • Similar error boundaries as next/image
  • Additional options for managing the aspect ratio of requested images

Usage

import Image from "next/image";
import { contentfulLoader } from "@delicious-simplicity/next-image-contentful-loader";

const Component = ({ image }) => {
  return (
    <>
      <Image
        loader={(props) => contentfulLoader(props, { fit: "crop", ar: "1:1" })}
        src={image.url}
        alt={image.title}
        width={image.width}
        height={image.height}
      />
    </>
  );
};

Required packages