Skip to content

Commit

Permalink
feat: allow hiding of lqip
Browse files Browse the repository at this point in the history
  • Loading branch information
BJvdA committed Apr 16, 2021
1 parent 9bd710c commit 4d3c2e9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@ interface ImageProps
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture#the_media_attribute
*/
media?: string;
/**
* Show a Low-Quality Image Placeholder.
*
* @default true
*/
showPlaceholder?: boolean;
}

export const Image = ({
fixed,
fluid,
height,
showPlaceholder = true,
smart,
width,
ref,
Expand Down Expand Up @@ -107,7 +114,9 @@ export const Image = ({
}}
/>

<Placeholder src={props.src} shouldShow={!isLoaded} />
{showPlaceholder && (
<Placeholder src={props.src} shouldShow={!isLoaded} />
)}

<Picture
{...pictureProps}
Expand Down

1 comment on commit 4d3c2e9

@vercel
Copy link

@vercel vercel bot commented on 4d3c2e9 Apr 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.