import-on-visibility

Detect viewport visibility and dynamically import modules to load on demand.

Updated Oct 26, 2025
One-click install
npx skills add https://github.com/jcsoftdev/pulzifi-back --skill import-on-visibility-jcsoftdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: import-on-visibility
Source: https://github.com/jcsoftdev/pulzifi-back/tree/main/.claude/skills/import-on-visibility
Command: npx skills add https://github.com/jcsoftdev/pulzifi-back --skill import-on-visibility-jcsoftdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Components that are not visible on initial render can waste bandwidth and delay perceived performance. Import-on-visibility provides a pattern to load such modules only when they enter the viewport, improving initial load time and user experience.

Core Features & Use Cases

  • Lazy-load below-the-fold components and images using the IntersectionObserver API.
  • Compatibility with popular React libraries like react-lazyload or react-loadable-visibility for rapid adoption.
  • Use Case: A dashboard with multiple charts and media tiles that load as the user scrolls, reducing initial bundle size and improving LCP.

Quick Start

Implement an IntersectionObserver-based wrapper to lazy-load modules when they become visible.

Frequently Asked Questions about import-on-visibility

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I lazy load React components when they enter the viewport?

To lazy load React components on demand, use an IntersectionObserver-based wrapper to dynamically import modules when they become visible in the viewport. This pattern delays loading off-screen content until needed, improving initial page performance.

What is import on visibility for web performance optimization?

Import on visibility is a web performance technique that dynamically loads off-screen components only when they enter the viewport. By deferring non-visible content, it reduces initial bundle size, saves bandwidth, and improves perceived load speed.

Can I use IntersectionObserver with react-lazyload for below-the-fold content?

Yes, you can use IntersectionObserver with compatibility-focused React libraries like react-lazyload or react-loadable-visibility. These tools provide wrapper components to trigger dynamic imports for below-the-fold content as users scroll.

What is the best way to reduce initial bundle size for a heavy React dashboard?

The best way to reduce initial bundle size for a heavy React dashboard is applying visibility-based lazy loading. By dynamically importing charts and media tiles only when they enter the viewport, you significantly improve Largest Contentful Paint.

Why does lazy loading components require browser compatibility checks?

Lazy loading components requires browser compatibility checks because the IntersectionObserver API may not be supported in older browsers. You must implement proper loading fallbacks to ensure modules still load correctly if the API is unavailable.