
import-on-visibility
Teaches visibility-based lazy loading using Intersection Observer
by patternsdevFree
Description
Import On Visibility is an agent skill that teaches visibility-based lazy loading, where components are loaded only when they scroll into view. Many components are not visible on the first screen, such as below-the-fold content, and they can wait until the user reaches them. Images are a common example, since they load only as the user scrolls down. The skill suggests the IntersectionObserver API to detect whether an element is in the viewport, and it names libraries such as react-lazyload and react-loadable-visibility that add this behavior quickly. Use it for components that are not visible on the initial page, and for lazy loading images, widgets or heavy components as the user scrolls. The skill also lists cases where it should not be used: above-the-fold content that must render at once, because deferring it causes layout shifts and a slower Largest Contentful Paint; lightweight components where lazy loading costs more than it saves; and content that must be in the initial HTML for SEO. The skill is published in the patternsdev/skills repository on GitHub.…
Highlights
- Loads components as they scroll into view
- Uses the IntersectionObserver API
- Covers lazy-loaded images and heavy components
- Lists cases where it should not be used
Ratings & Reviews
No ratings yet
Be the first to rate import-on-visibility.
People also visit

react-on-screen
A wrapper component to track if your react component is visible on screen
import-on-visibility FAQ
What does this skill make the agent do?
It adds visibility-based lazy loading, so below-the-fold images and components load as the user scrolls to them.
How does it detect visibility?
With the IntersectionObserver API, or with libraries such as react-lazyload or react-loadable-visibility.
When should I avoid it?
For above-the-fold content that must render at once, lightweight components, and content that search engines need in the initial HTML.
What do the security audits say?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
How do I install it?
Run npx skills add https://github.com/patternsdev/skills --skill import-on-visibility.
What are the best import-on-visibility alternatives?
Popular alternatives to import-on-visibility include import-on-interaction, dynamic-import and animation-on-scroll. See all import-on-visibility alternatives












