Skip to content

Commit

Permalink
docs: add rudimentary information about option to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdinonolte committed Nov 28, 2023
1 parent 2675bd6 commit 0728319
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ export default defineConfig({
class: 'img thumb',
loading: 'lazy',
widths: [48, 96],

// When set to true, the width and height of the image will be
// added as keys to the last image object on the returned array
// This is useful to prevent layout shifts from loading image
//
// Defaults to false
inferDimensions: true,

// When set to true a base64-inlined 20px wide version of the
// image will be added to the `placeholder` key of the last
// image in the returned array. This can be used to roll your
// own lazy loading, where a blurry version of the image is
// displayed until the real image loads in.
//
// Defaults to false
generateBlurryPlaceholder: true,
formats: {
webp: { quality: 50 },
jpg: { quality: 70 },
Expand Down Expand Up @@ -79,6 +95,13 @@ expect(thumbnails).toEqual([
src: '/assets/logo.81d93491.jpeg',
class: 'img thumb',
loading: 'lazy',

// If inferDimensions is set to true
width: 100,
height: 100,

// If generateBlurryPlaceholder is set to true
placeholder: 'data:image/png;base64,...'
},
])
```
Expand Down

0 comments on commit 0728319

Please sign in to comment.