Web Component Utils - Live Examples

1 min read Original article ↗

🔍 Intersection Observer

Detects when content becomes visible in the viewport - perfect for lazy loading, animations, and analytics.

  • Event-based API with custom event names
  • Configurable threshold and root margin
  • Shadow DOM with slot support
  • Works with any framework or vanilla JS

🌐 Get Request

Handles GET requests with built-in caching, loading states, and error handling.

  • Built-in LRU cache with configurable size
  • Automatic fetching when URL changes
  • Custom event names for loading, success, and error states
  • Manual and automatic fetch modes