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
React Component to lazy load and other components/elements and use the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
21
+
Fast 1.15kB, Gzip 0.63KB, React Component to lazy load and other components/elements and use the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
The `tag` option allows you to set the html element's tag even when it has no content.
100
109
101
110
#### rootMargin
111
+
102
112
Type: `String` Default: `0%`
103
113
104
114
The `rootMargin` option allows you to specify how far below, above, to the left, and to the right of the viewport you want to _begin_ displaying your content. If you specify `0`, your content will be displayed as soon as it is visible in the viewport, if you want to load _100px_ below or above the viewport, use `100`.
105
115
106
116
#### threshold
117
+
107
118
Type: `number | number[]` Default: `0`
108
119
109
120
This `threshold` option allows you to specify how much of the element must be shown on the screen prior to loading. This requires a _width_ and _height_ to be set on the `<LazyLoad>` component in order for the browser to calcualte the viewable area.
110
121
111
122
#### className
123
+
112
124
Type: `String`
113
125
114
126
The `className` option allows you to set the element's className even when it has no content.
115
127
116
128
#### style
129
+
117
130
Type: `CSSProperties`
118
131
119
132
The `style` option allows you to set the element's style even when it has no content.
120
133
121
134
#### freezeOnceVisible
135
+
122
136
Type `Boolean`
123
137
124
138
A Boolean to execute when the content appears on the screen.
0 commit comments