Skip to content
Skillpedia
Websites & UI (frontend)75k · #2888

import-on-interaction

What it does

This skill reviews a page's code for heavy features that load before anyone uses them. It is for developers who want faster first loads.

When to use it

  • ✓When a chat widget or map loads on every visit but few people use it.
  • ✓When a page's first load includes an editor or export tool no one has opened.
  • ✓When your initial code bundle is much larger than the first view needs.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/import-on-interaction/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/import-on-interaction/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you load my chat widget only when a visitor clicks to open it?”

5 new skills a week. 1 minute to read.

How it works

The agent finds features that are only needed after a click, focus or hover, and suggests loading them with a dynamic import. It also suggests showing immediate feedback while the code loads.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Load non-critical code on user interaction

Users should not pay the download, parse, and execution cost for features they may never use. Import-on-interaction shrinks initial JavaScript, reduces main-thread work during page load, and keeps the first view focused on content that matters immediately.

Quick Reference

  • Move non-essential code behind clicks, focus, hovers, or explicit user actions
  • Use dynamic import() so the code is absent from the initial route bundle
  • Show immediate UI feedback while the deferred chunk loads
  • Use this for chat widgets, editors, maps, filters, and export flows that are not needed on first paint

Check

Inspect this route or component for heavy modules, widgets, or third-party scripts that load on first render but are only needed after a user clicks, focuses, hovers, or opens a panel.

Fix

Move the non-critical dependency behind a user-triggered dynamic import(), add immediate loading feedback, and ensure the initial render still works without the deferred feature.

Explain

Explain import-on-interaction, why it improves initial performance, and which features are safe to defer until the user shows intent.

Code Review

Inspect event handlers, modal triggers, drawers, editors, maps, export actions, and third-party widgets. Flag code that is included in the initial bundle even though it is only needed after a user interaction, and verify the fix keeps the initial path lighter without degrading the triggered flow.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/performance/import-on-interaction

FAQ

What is a dynamic import?

It loads a piece of code only when it is needed, instead of with the first page load.

Which features are safe to defer?

The skill mentions chat widgets, editors, maps, filters and export flows that are not needed on first view.

Does the page still work without the feature?

The skill says the initial render should still work without the deferred feature.

Details

Original description by the author

Use when reviewing slow initial loads caused by optional features. Prioritize code that is expensive to download or execute and not required for the first viewport, first input, or core task completion.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#2888
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills