prongs
GitHub

media.enlarged

A photo shown as large as fits, in a frame of one fixed size so flipping between photos never moves anything: the photo in a dialog.media, edge to edge on its side. On small screens it is a square across the full width

Component

Renders

<img>

Profile

Comes from

Read https://www.prongs.dev/docs/intents/media/enlarged.md and tell me whether media.enlarged fits what I am building.

Example

Preview
Ada LovelaceAL
<Media intent="media.enlarged" src={post.coverUrl} alt="What the image shows" />

Connections

Choosing between neighbours

  • If it is

    Use

  • A photo shown as large as fits, in a frame of one fixed size so flipping between photos never moves anything: the photo in a dialog.media, edge to edge on its side. On small screens it is a square across the full width

    media.enlarged
  • A photo in a list or grid, cropped to fit

    media.image

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 media.enlarged 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.

  • frame.cover

    Wide rounded rectangle; centres the fallback text when there is no image

    flex aspect-video w-full items-center justify-center
    overflow-hidden rounded-lg bg-surface-active object-cover
    text-sm text-surface-muted
  • media.enlarged

    A photo shown as large as fits, in a frame of one fixed size so flipping between photos never moves anything: the photo in a dialog.media, edge to edge on its side. On small screens it is a square across the full width

    aspect-square h-auto w-full max-w-none rounded-none object-cover
    md:aspect-[3/4] md:h-[min(85vh,44rem)] md:w-auto md:max-w-[60vw]
Final classes
flex items-center justify-center overflow-hidden
bg-surface-active text-sm text-surface-muted aspect-square
h-auto w-full max-w-none rounded-none object-cover
md:aspect-[3/4] md:h-[min(85vh,44rem)] md:w-auto md:max-w-[60vw]
Definition
TS
'media.enlarged': {
kind: 'semantic',
description: 'A photo shown as large as fits, in a frame of one fixed size so flipping between photos never moves anything: the photo in a dialog.media, edge to edge on its side. On small screens it is a square across the full width',
refs: ['frame.cover'],
binding: {
classes: 'aspect-square h-auto w-full max-w-none rounded-none object-cover md:aspect-[3/4] md:h-[min(85vh,44rem)] md:w-auto md:max-w-[60vw]',
},
notFor: [
{
context: 'a photo in a list or grid, cropped to fit',
instead: 'media.image',
},
],
},