Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Overview

I am using ImageKit SDK to build a URL for my React App. I choose the native way instead of imagekit-react for some reasons. However, I am facing an issue with a low-quality image placeholder (lqip in imagekit-react). How can I implement it using ImageKit SDK?

You must be logged in to vote

Replies: 1 comment

Comment options

For more context

     <img
        id={id}
        width='100%'
        height='100%'
        loading='lazy'
        onClick={onClick}
        {...imageKitUrlBuilder(url, [
          { height: '100%', width: widthVar, cropMode: 'extract' },
          // { quality: '20', blur: '10' },
        ])}
      />

Inside of imageKitUrlBuilder

const imagekit = new IKCore({
  publicKey,
  urlEndpoint,
});

function imageKitUrlBuilder(
  src: string,
  transformation?: TransformationOptions
) {
  if (!src.includes('imagekit.io')) return { src };

  return {
    src: imagekit.url({
      src,
      transformation,
    }),
  };
}
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.