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
@@ -118,7 +118,34 @@ import { uploadcareLoader } from '@uploadcare/nextjs-loader';
118
118
/>
119
119
```
120
120
121
-
**Option 3**. Use the [next-image-loader](https://www.npmjs.com/package/next-image-loader) plugin to enable Uploadcare image loader for all images by default
121
+
**Option 3 (Next.js v13+ only)**. Use the [`loaderFile` setting][loader-file] to enable Uploadcare image loader for all images by default.
122
+
123
+
1. Configure the `loaderFile` in your `next.config.js` like the following:
2. Use `Image` as usual, with Uploadcare loader enabled implicitly:
135
+
136
+
```tsx
137
+
importImagefrom'next/image';
138
+
139
+
<Image
140
+
alt="A test image"
141
+
src="https://your-domain/image.jpg"
142
+
width="400"
143
+
height="300"
144
+
quality="80"
145
+
/>
146
+
```
147
+
148
+
**Option 4**. Use the [next-image-loader](https://www.npmjs.com/package/next-image-loader) plugin to enable Uploadcare image loader for all images by default
122
149
123
150
In that case, you may not need the `loader: "custom"` setting in your `next.config.js`.
124
151
@@ -180,19 +207,45 @@ There are two possible use cases:
180
207
181
208
#### When `src` is a string
182
209
183
-
This options is available for the `UploadcareImage` component only. It won't work when you're using custom loader directly.
210
+
If you pass `placeholder="blur"` to the `Image` or `UploadcareImage` component, the `blurDataURL` property will be used as the placeholder. In this case you must provide the `blurDataURL` property using our `getBlurDataURL` server-side helper.
184
211
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`.
212
+
Here is the ``getBlurDataURL` interface:
213
+
214
+
```ts
215
+
function getBlurDataURL(
216
+
src:string,
217
+
width=10,
218
+
quality=1
219
+
):Promise<string>
220
+
```
221
+
222
+
Usageexample:
186
223
187
224
```tsx
188
-
<UploadcareImage
189
-
alt="A test image"
190
-
src="https://your-domain/image.jpg"
191
-
width="400"
192
-
height="300"
193
-
quality="80"
194
-
placeholder="blur"
195
-
/>
225
+
import UploadcareImage, { getBlurDataURL } from '@uploadcare/nextjs-loader';
0 commit comments