Socket
Book a DemoInstallSign in
Socket

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

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

A comprehensive [Imgix](https://imgix.com/) image loader for the [Next.js Image component](https://nextjs.org/docs/api-reference/next/image).

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
104
8.33%
Maintainers
3
Weekly downloads
 
Created
Source

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

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

Features

  • Allows for native imgix image params/options
  • Similar error boundaries as next/image
  • Uses native buildUrl from react-imgix
  • Replaces image TLD's for other CDN's
    • Shopify

Usage

import Image from "next/image";
import { imgixLoader } from "@delicious-simplicity/next-image-imgix-loader";

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

Options

shopify

This option transforms any passed url to the loader with cdn.shopify.com and replaces it the value of the NEXT_PUBLIC_SHOPIFY_IMGIX_URL environment variable. You can set this value in whatever local .env file in your project.

Required: ❌

Type: boolean

Default: false

Usage:

imgixLoader(props, { fit: "crop", ar: "1:1" }, { shopify: true });

Required packages

Keywords

nextjs

FAQs

Package last updated on 06 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.