dialog.media
Shows one photo or video large over the dimmed page, with its details beside it: who posted it, the caption, comments. A click outside closes it. On small screens it fills the screen, the photo between its title and its details
Read https://www.prongs.dev/docs/intents/dialog/media.md and tell me whether dialog.media fits what I am building.Dialog intents
Example
<Dialog intent="dialog.media" open={open} onClose={close} label={photo.title}>
<Media intent="media.enlarged" src={photo.src} alt={photo.title} />
</Dialog>Connections
Choosing between neighbours
If it is
Use
Shows one photo or video large over the dimmed page, with its details beside it: who posted it, the caption, comments. A click outside closes it. On small screens it fills the screen, the photo between its title and its details
dialog.mediaA task or a form
dialog.task
For registry authors
Pack intent. prongs add media puts the media pack’s intents in your registry. They are then yours like the starter intents: rename, restyle and add to them, and see them with prongs add gallery.
What this intent is built from and its entry in components/prongs/registry.ts. You only need this to change how it looks or to add an intent like it.
How dialog.media resolves, and its definition
Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.
surface.overlayFloats over a dimmed page and starts its own stack of surfaces
surface-overlay m-auto rounded-lg border border-surface-border shadow-xl backdrop:bg-black/50
dialog.mediaShows one photo or video large over the dimmed page, with its details beside it: who posted it, the caption, comments. A click outside closes it. On small screens it fills the screen, the photo between its title and its details
m-0 h-dvh max-h-none w-full max-w-none overflow-y-auto rounded-none border-0 p-0 backdrop:bg-black/80 md:m-auto md:h-fit md:max-h-[calc(100dvh-2rem)] md:w-fit md:max-w-[calc(100%-2rem)] md:overflow-hidden md:rounded-lg md:border
surface-overlay border-surface-border shadow-xl m-0 h-dvh max-h-none w-full max-w-none overflow-y-auto rounded-none border-0 p-0 backdrop:bg-black/80 md:m-auto md:h-fit md:max-h-[calc(100dvh-2rem)] md:w-fit md:max-w-[calc(100%-2rem)] md:overflow-hidden md:rounded-lg md:border
'dialog.media': {
kind: 'semantic',
description: 'Shows one photo or video large over the dimmed page, with its details beside it: who posted it, the caption, comments. A click outside closes it. On small screens it fills the screen, the photo between its title and its details',
refs: ['surface.overlay'],
binding: {
classes: 'm-0 h-dvh max-h-none w-full max-w-none overflow-y-auto rounded-none border-0 p-0 backdrop:bg-black/80 md:m-auto md:h-fit md:max-h-[calc(100dvh-2rem)] md:w-fit md:max-w-[calc(100%-2rem)] md:overflow-hidden md:rounded-lg md:border',
},
notFor: [{ context: 'a task or a form', instead: 'dialog.task' }],
},