# `PhoenixKitWeb.Components.MediaViewer`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.164/lib/phoenix_kit_web/components/media_viewer.ex#L1)

Standalone media lightbox ("slide box") LiveComponent.

Renders a `<dialog>` modal showing one file from an ordered set, with
prev/next navigation (chevrons + ←/→ keys) and Escape/backdrop close.
Per-file content (the pan/zoom canvas with annotations + comments
thread for images, video/PDF/icon fallback otherwise) is delegated to
the shared `PhoenixKitWeb.Components.MediaCanvasViewer` child
LiveComponent — the same one MediaBrowser uses, so admins get the
full annotation experience here too.

Reusable on its own or embedded by `MediaGallery`.

## Attrs
- `id` — required
- `files` — ordered list of file UUIDs (the navigable set)
- `current` — initial UUID to show (must be in `files`). Treated as
  a seed: once mounted, internal navigation state takes precedence
  over subsequent `current` attr 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.
- `current_user` — required for the composer / comments thread to
  render. nil-tolerant (lightbox falls back to view-only).
- `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})`.

# `render`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
