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
{{ message }}
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/docs/components/app-components-lazy-img/app-components-lazy-img.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
The "Lazy Image" component is a dead simple component to lazy load images.
4
4
5
-
It leverages the IntersectionObserver API to lazy load images and also allows you to trigger "manually" their loading.
5
+
It leverages the native lazy-loading when available and the IntersectionObserver API as fallback to lazy load images. It also allows you to trigger "manually" their loading.
6
6
7
7
An `<img/>` tag is per default use to display the image but optionally it could parse `SVG` too.
8
8
@@ -44,6 +44,7 @@ This component offers the following options which could be set using attributes:
44
44
| aria-label | string || If you are using the above SVG option, provide the accessibility information using this attribute |
45
45
| observer-root-margin | string | 100px 0px | A string which specifies a set of offsets to add to the root's bounding_box when calculating intersections, effectively shrinking or growing the root for calculation purposes. [More info.](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver)|
46
46
| observer-threshold | number or number[]|| Either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to total bounding box area for the observed target. [More info.](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver)|
47
+
| intrinsicsize | string | An intrinsicsize for the native lazy-loading (see [Native lazy-loading for the web](https://web.dev/native-lazy-loading))
47
48
48
49
### Theming
49
50
@@ -76,7 +77,7 @@ await element.lazyLoad();
76
77
77
78
### Fallback
78
79
79
-
In case the browsers would not support the Intersection Observer, images are going to be loaded without any delay when the component load respectively if the browser does not implement the Intersection Observer API images are displayed and not lazy loaded.
80
+
In case the browser would not support the native native lazy-loading or the Intersection Observer API, images are going to be loaded without any delay when the component load respectively if the browser does not implement the Intersection Observer API images are displayed and not lazy loaded.
<p>The "Lazy Image" component is a dead simple component to lazy load images.</p>
35
-
<p>It leverages the IntersectionObserver API to lazy load images and also allows you to trigger "manually" their loading.</p>
35
+
<p>It leverages the native lazy-loading when available and the IntersectionObserver API as fallback to lazy load images. It also allows you to trigger "manually" their loading.</p>
36
36
<p>An <code><img/></code> tag is per default use to display the image but optionally it could parse <code>SVG</code> too.</p>
37
37
<h2id="app-components-lazy-img-table-of-contents">Table of contents</h2>
38
38
<ul>
@@ -117,6 +117,12 @@ export class AppComponentsLazyImg {
117
117
<td></td>
118
118
<td>Either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to total bounding box area for the observed target. <ahref="https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver">More info.</a></td>
119
119
</tr>
120
+
<tr>
121
+
<td>intrinsicsize</td>
122
+
<td>string</td>
123
+
<td>An intrinsicsize for the native lazy-loading (see <ahref="https://web.dev/native-lazy-loading">Native lazy-loading for the web</a>)</td>
<p>In case the browsers would not support the Intersection Observer, images are going to be loaded without any delay when the component load respectively if the browser does not implement the Intersection Observer API images are displayed and not lazy loaded. </p>
208
+
<p>In case the browser would not support the native native lazy-loading or the Intersection Observer API, images are going to be loaded without any delay when the component load respectively if the browser does not implement the Intersection Observer API images are displayed and not lazy loaded. </p>
203
209
<h3id="app-components-lazy-img-trying-it-out">Trying it out</h3>
204
210
<p>This component lazy load images when these are not presented in the viewport. If you would use this component in a simple test containing only a couple of images, respectively no content or no real use case where the images are effectively offscreen, assign a default height to components in order to ensure that some are effectively placed outside of the window <ahref="https://github.com/deckgo/deckdeckgo/issues/128#issuecomment-493979841">[#128]</a>.</p>
0 commit comments