You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-8Lines changed: 64 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,12 @@ The package helps you use the Uploadcare's transformation and CDN services from
12
12
13
13
It provides the `uploadcareLoader` function, which you can use as [a custom loader for the Next's Image component](https://nextjs.org/docs/api-reference/next/image#loader), and the `UploadcareImage` component with the custom loader enabled by default.
14
14
15
-
16
15
*[Demo](#demo)
17
16
*[Dependencies](#dependencies)
18
17
*[Installation](#installation)
19
18
*[Configuration](#configuration)
20
19
*[Usage](#usage)
20
+
*[Props](#props)
21
21
*[Notes](#notes)
22
22
*[Known Issues](#known-issues)
23
23
*[Links](#links)
@@ -28,7 +28,7 @@ Look at the demo [here][demo-link].
28
28
29
29
## Dependencies
30
30
31
-
The only dependency is Next.js >= 10.0.5.
31
+
The only dependency is Next.js >= 10.0.5.
32
32
33
33
## Installation
34
34
@@ -108,7 +108,7 @@ The `UploadcareImage` component supports the same parameters as the Next `Image`
@@ -167,15 +167,71 @@ import anotherLoader from '[another-loader-project-name]';
167
167
168
168
where `anotherLoader` will be used instead of the Uploadcare loader for this particular image.
169
169
170
+
## Props
171
+
172
+
### `placeholder` and `blurDataURL`
173
+
174
+
[Read Next.js Image Component docs](https://nextjs.org/docs/api-reference/next/image#placeholder) about `placeholder` and `blurDataURL`.
175
+
176
+
There are two possible use cases:
177
+
178
+
1.[When `src` is a string](#when-src-is-a-string)
179
+
2.[When `src` is a static import](#when-src-is-a-static-import)
180
+
181
+
#### When `src` is a string
182
+
183
+
This options is available for the `UploadcareImage` component only. It won't work when you're using custom loader directly.
184
+
185
+
If you pass `placeholder="blur"` to the `UploadcareImage` component, it will generate `blurDataURL` with the URL of the placeholder image (not base64) and use it as a placeholder. You can override `blurDataURL`.
- Ifyouhavejpegslargerthan 3000pxandyouwantloadertoresizethemupto 5000px, youneedtopassfilenamewith`jpeg`or`jpg`extensiontothesrcurl. See [Outputimagedimensionsdocs](https://uploadcare.com/docs/transformations/image/#dimensions) for more details. When no filename provided, we'll treat the image as non-jpeg and can resize it up to 3000px only.
- Next.jsImagecomponentallowsnumericonly`quality`value. UploadcareCDNsupportsstring-basedqualityonly (see [ourdocs](https://uploadcare.com/docs/transformations/image/compression/#operation-quality)). So numeric quality values will be mapped onto string ones using the following intervals:
0 commit comments