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…
от PatternsDev★ 261 звезда на GitHubОб этом скилле
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, 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
IntersectionObserverAPI to detect when components enter the viewport - Use libraries like
react-lazyloadorreact-loadable-visibilityfor quick implementation - Provide a loading fallback component while the module is being loaded
Details
Whenever a component is rendered to the screen, react-loadable-visibility detects that the element should be visible on the screen. Only then, it will start importing the module while the user sees a loading component being rendered.
This fallback component lets the user know that our application hasn't frozen: they simply need to wait a short while for the module to be loaded, parsed, compiled, and executed!
Source
Установить import-on-visibility в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл 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.
Как установить скилл import-on-visibility?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл import-on-visibility запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic