Standalone image lightbox ("slide box") LiveComponent.
Renders a modal showing one image from an ordered set, with prev/next
navigation (chevrons + ←/→ keys), Escape/backdrop close, and a Download link.
Images render via <.image_set> (responsive <picture>).
Reusable on its own or embedded by MediaGallery.
Attrs
id— requiredfiles— ordered list of file UUIDs (the navigable set)current— initial UUID to show (must be infiles). Treated as a seed: once the component is mounted, internal navigation state takes precedence over subsequentcurrentattr changes. This is intentional when the component is mount-gated (:if={...}) so it remounts fresh on each open. A standalone consumer that keeps the component mounted and wants to jump to a different image programmatically must unmount and remount it.variants_map— optional%{uuid => variants}; resolved internally if nil/omitted. Note:%{}(empty map) is truthy and counts as pre-resolved — passnilor omit to trigger internal resolution.file_structs— optional[%Storage.File{}]; resolved internally if nil/omitted. Note:[](empty list) is truthy and counts as pre-resolved — passnilor omit to trigger internal resolution.notify— optional{module, id}; see Close below
Close
On close, if notify: {module, id} is set:
send_update(module, id: id, media_viewer_closed: true).
Otherwise: send(self(), {__MODULE__, id, :closed}).
Summary
Functions
Callback implementation for Phoenix.LiveComponent.render/1.
Functions
Callback implementation for Phoenix.LiveComponent.render/1.