# media.image

An image that illustrates content: an article cover, a screenshot

Component: [`<Media>`](https://www.prongs.dev/docs/components/media.md) · Renders: `<img>` · Profile: [UI](https://www.prongs.dev/docs/intents/ui.md)

## Example

```tsx
<Media intent="media.image" src={post.coverUrl} alt="What the image shows" />
```

## Choosing between neighbours

Find the row that describes your element, and use the intent on the right.

| If it is for… | Use |
|---|---|
| An image that illustrates content: an article cover, a screenshot | `media.image` (this page) |
| An image that illustrates content (rather than [`media.person`](https://www.prongs.dev/docs/intents/media/person.md)) | `media.image` (this page) |
| A photo in a list or grid, cropped to fit (rather than [`media.enlarged`](https://www.prongs.dev/docs/intents/media/enlarged.md)) | `media.image` (this page) |
| An image that illustrates an article (rather than [`media.artwork`](https://www.prongs.dev/docs/intents/media/artwork.md)) | `media.image` (this page) |
| A picture (rather than [`media.embed`](https://www.prongs.dev/docs/intents/media/embed.md)) | `media.image` (this page) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`frame.cover`](https://www.prongs.dev/docs/intents/ui.md#frame-cover)

## For registry authors

**Starter intents.** These are the intents `prongs add` puts in your registry, shown in this site’s theme. Yours are your own `registry.ts`: 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.image 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`](https://www.prongs.dev/docs/intents/ui.md#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-muted object-cover text-sm
  text-muted-foreground
  ```

- `media.image` (this page) — An image that illustrates content: an article cover, a screenshot

Final classes

```
flex aspect-video w-full items-center justify-center
overflow-hidden rounded-lg bg-muted object-cover text-sm
text-muted-foreground
```

Definition

```ts
'media.image': {
  kind: 'semantic',
  description: 'An image that illustrates content: an article cover, a screenshot',
  refs: ['frame.cover'],
},
```
