Media & Gallery Snippets — Free HTML CSS JS Galleries, Lightboxes & Players
54 media components · Image Galleries, Lightboxes, Zoom & Magnifiers, Before/After Sliders, Audio & Video Players, 3D Model Viewers · Exports to React, Vue, Angular & Tailwind
What's included
Features
About this category
Media & Gallery Snippets — Free Image Galleries, Lightboxes, Players & 3D Viewers
Media components are how people look at, listen to, and inspect content: a photo gallery that opens into a lightbox, a product image you can zoom into, a before/after comparison, a podcast player with chapter markers, or a 3D model you can spin. This collection groups all of them in one place.
Every snippet is plain HTML, CSS, and JavaScript. Some use a focused library from a CDN — PhotoSwipe, GLightbox, Viewer.js, medium-zoom, Howler.js, Tone.js, Three.js, or Babylon.js — and say so in the snippet.
Galleries and lightboxes. Photo Gallery with Lightbox, Thumbnail Gallery, Filter Tabs Gallery, Bootstrap Masonry Image Gallery, Instagram Gallery Lightbox, PhotoSwipe Full-Screen Gallery with Captions, and GLightbox Mixed Media Lightbox cover browsing a set of images and opening one full screen.
Zoom, magnify, and inspect. Image Magnifier, Product Image Magnify Lens, medium-zoom Article Image Zoom, Pinch & Scroll Zoom Image Viewer, Panzoom Zoomable Floor Plan, Viewer.js Product Image Viewer, 360° Product Spin Viewer, and Image Hotspot with Tooltips let people look closer at a single image.
Comparison. Before/after image sliders — including a CSS-only version — and a Video Scrub Comparison Slider show two states of the same scene.
Audio and video. A custom video player, podcast player with speed and skip controls, episode chapters, audio players with playlists and visualizers, picture-in-picture, live captions, a voice memo recorder, Media Session controls, and playable synth pads and piano keys.
3D models. GLB model viewers with hotspots, lighting studios, exploded views, colour configurators, and wireframe toggles, plus Three.js and Babylon.js product viewers.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
Not all of them. Several galleries, the magnifier, and the before/after sliders are plain JavaScript and CSS. Others use a focused library such as PhotoSwipe, GLightbox, Viewer.js, or medium-zoom, loaded from a CDN, when that library solves the problem better than hand-written code.
Replace the model URL in the snippet with the URL of your own .glb file. Host it on the same origin or a server that sends CORS headers, and keep file sizes small with compressed textures so the model loads quickly on mobile.
Yes, with the usual browser rules: playback with sound must start from a user gesture such as a tap, and iOS may use its own full-screen video player unless the video has the playsinline attribute.
Yes. Every snippet has a framework export. Library-based viewers initialise on mount and clean up on unmount, and media elements are referenced with a ref instead of a DOM query.