A lightbox is the overlay that pops up when you click a small image and a larger version appears in the middle of the screen, with the rest of the page dimmed behind it. You view it, then close it and you are right back where you were. The name comes from the old photographer’s lightbox used to inspect slides.
Think of it like a museum spotlight. The room goes dark and one painting is lit so your attention goes nowhere else. A web lightbox does the same: it fades the page and puts a single image or video at the center of focus. It is commonly built with a small JavaScript library and pairs well with lazy loading so the big image only downloads on click.
You see lightboxes everywhere once you notice them. A product page where each photo zooms in, a portfolio where one click reveals the full project shot, or a gallery where left and right arrows step through a set without ever reloading. The visitor stays in one place, which keeps the flow intact.
Done well it feels smooth and stays out of the way. Done badly it traps people, especially on phones where the close button is tiny, so the close action and keyboard escape both need to work. A good lightbox also locks the background from scrolling and returns focus to the thumbnail you came from, which matters for anyone using a screen reader or accessible UX.
At TopDevs we use lightboxes for galleries and portfolios where keeping the visitor on the page matters, and we make sure they close easily on every device.