Import on Visibility
Teaches visibility-based lazy loading using Intersection Observer. Use when you have below-the-fold components or images that don't need to load until the user scrolls to them.
Install
npx skills add PatternsDev/skills --skill import-on-visibilitygit clone --depth 1 https://github.com/PatternsDev/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/javascript/import-on-visibility ~/.claude/skills/import-on-visibilityPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Import On Visibility Besides user interaction, we often have components that aren't visible on the initial page. A good example of this is lazy loading images that aren't directly visible in the viewport, but only get loaded once the user scrolls down. As we're not requesting all images instantly, we can reduce the initial loading time. We can do the same with components! In order to know whether components are currently in our viewport, we can use the [`IntersectionObserver` API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API), or use libraries such as `react-lazyload` or `react-loadable-visibility` to quickly add import on visibility to our application. ## When to Use - Use this for components that aren't visible on the initial page (e.g., below-the-fold content) - This is helpful for lazy loading images, widgets, or heavy components as the user scrolls ## When NOT to Use - For above-the-fold content that must render immediately — deferring it causes visible layout shifts and slow LCP - When the component is lightweight enough that lazy loading adds more overhead than it saves - When the content is critical for SEO and needs to be present in the initial HTML ## Instructions - Use the `IntersectionObserver` API to detect when components enter the viewport - Use libraries like `react-lazyload` or `react-loadable-visibility` for quick implementation - Provide a loading fallback component while the module is being loaded ## Details
Details
- Skill name
import-on-visibility- Repository
- PatternsDev/skills
- Path
javascript/import-on-visibility/SKILL.md- Repo updated
- 15 April 2026
FAQ
What does the Import on Visibility skill do?
Teaches visibility-based lazy loading using Intersection Observer. Use when you have below-the-fold components or images that don't need to load until the user scrolls to them.
How do I install the Import on Visibility skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add PatternsDev/skills --skill import-on-visibility. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Import on Visibility popular?
It lives in PatternsDev/skills, which has 259 GitHub stars and 28 forks.
Related skills
AI UI Patterns
259PatternsDev/skills
Teaches design patterns for building AI-powered React interfaces. Use when creating chatbots, intelligent assistants, streaming UIs, or any AI-driven user experience in React.
Async Components
259PatternsDev/skills
Teaches async component loading in Vue for performance optimization. Use when you have heavy components that aren't needed on initial render and can be loaded on demand.
Bundle Splitting
259PatternsDev/skills
Teaches bundle splitting techniques for web performance. Use when your application has a large JavaScript bundle that affects load times or when you need to reduce FCP/LCP.
Islands Architecture
259PatternsDev/skills
Teaches the islands architecture pattern for partial hydration. Use when building content-heavy sites where most of the page is static and only small regions need interactivity.
Import on Interaction
259PatternsDev/skills
Teaches interaction-based lazy loading for non-critical resources. Use when you have heavy components or libraries that are only needed after user interaction like clicks, hovers, or form input.
Js Performance Patterns
259PatternsDev/skills
Provides framework-agnostic JavaScript runtime performance patterns. Use when optimizing hot paths, loops, DOM operations, caching, or data structure choices in performance-critical code.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.