IO Examples
Purchase
Practical, real world React examples of
IntersectionObserver API
No dependencies
Examples use only IntersectionObserver API. No external JavaScript or CSS libraries used in examples
React components
Each example is available as a React component. It is written in TypeScript and uses React hooks to manage internal states
Easy to understand
Each example contains one or two source files that have less than 100 lines of code. It's easy to understand and follow
Reusable patterns
A few patterns are used repeatedly such as making animations, lazy loading, etc. You can use them for your real use cases
Demo
Beginner
Elementary
Intermediate
Advanced
Animation
Don't animate an element unless users see it.
Animate a Gauge chart
Animate a pie chart
Animate a progress bar
Animate a vertical timeline
Animate statistic numbers
Effect
Toggle or add special effect to an element when it becomes visible.
Add a shadow to sticky header when scrolling down
Blur the hero background image when scrolling down
Change the background color while scrolling
Dim the heading when scrolling down
Highlight marks on scroll
Scale photos in a gallery on scroll
Shrink the header
New
Switch between themes on scroll
Lazy Load
Only load an element when it's visible. It improves the loading performance of your page.
Feed of multiple images
Lazy load a Google map
Lazy load a video
Lazy load an iframe
Lazy load an image
Lazy load images in a gallery
Lazy load the background image
Load more data when scrolling to the bottom
Load more data when scrolling to the top
Sticky
Stick an element at the top or bottom of page. Because there are cases you can't use 'position: sticky'.
Stick the secondary navigation
New
Stick the sidebar to the top on scroll
New
Stick the table header to the top on scroll
Tracking
Do something when users scroll to given position on the page.
Activate the current section of a sticky navigation
Create a full page slider
Determine the current page in a multiple pages viewer
Display a reading progress bar at the top of page
Highlight the current section in the table of contents
Notify unread messages
Pause a video player when it is not visible
Scroll to the bottom to accept Terms of service
Show a subscription form when scrolling to the bottom
Show a video player at the corner when it is not visible
Show CTA buttons when scrolling down
Show Go to top button when being at the bottom of page
Show reading progress in a Go to top button
Show the title in the header when scrolling down
Toggle a hidden navigation
IntersectionObserver API
Practical, real world React examples
Purchase