
import-on-interaction
Teaches interaction-based lazy loading for non-critical resources
by patternsdevFree
Description
Import On Interaction is an agent skill that teaches interaction-based lazy loading for non-critical resources. Pages often include code for parts of the interface a user does not see until they click or scroll. This applies to first-party code, and also to third-party widgets such as video players or chat widgets, which often show their main interface only after a button click. The skill says to defer that code until the user actually needs it, which helps First Input Delay and Time to Interactive. Use it when you have third-party widgets or heavy components that are costly to load eagerly, and when you want to defer non-critical code until the user acts. The page includes a section on when not to use the technique, so the agent can avoid deferring code that the first render needs. The skill is published in the patternsdev/skills repository on GitHub.…
Highlights
- Defers code for parts users open only on click or scroll
- Covers third-party widgets such as video players and chat
- Targets First Input Delay and Time to Interactive
- Includes guidance on when not to use it
Ratings & Reviews
No ratings yet
Be the first to rate import-on-interaction.
People also visit

react-ui-patterns
Modern React UI patterns for loading states, error handling, and data fetching
import-on-interaction FAQ
What does this skill make the agent do?
It defers code and widgets that are only needed after the user clicks or scrolls, so the first load is lighter.
Which widgets does it mention?
Video players and chat widgets that need a button click before the main interface appears.
Which metrics does it aim to improve?
First Input Delay and Time to Interactive.
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-interaction.
What are the best import-on-interaction alternatives?
Popular alternatives to import-on-interaction include import-on-visibility, dynamic-import and preload. See all import-on-interaction alternatives










