---
title: "Media"
description: "Image card: photo, tag, title (places, products, articles)."
---

> Documentation Index
> Fetch the complete documentation index at: https://gistui.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Media

```gistui
root = Grid(Media("https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?w=900&q=75&auto=format&fit=crop", title:"Tokyo", subtitle:"Japan's futuristic capital", tag:"Must-see", v:overlay), Media("https://images.unsplash.com/photo-1493976040374-85c8e12f0c0e?w=900&q=75&auto=format&fit=crop", title:"Kyoto", subtitle:"Thousands of shrines", tag:"Cultural", meta:"2 days"), cols:2)
```

## Signature

This is the line a model reads in the system prompt.

```gistui
Media(src, title:str, subtitle:str, tag:str, meta:str, v:below|overlay|cover, ratio:str, href:str, alt:str, do:[@step…], zoom)
```

- **Group:** Content
- **Children:** No
- **Positional arguments:** `src` (a trailing `?` means it may be left out)

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `src` | string (URL) | positional, required |  |
| `title` | string | named: `title:…` |  |
| `subtitle` | string | named: `subtitle:…` |  |
| `tag` | string | named: `tag:…` |  |
| `meta` | string | named: `meta:…` |  |
| `v` | `below` · `overlay` · `cover` | named: `v:…` | Default `"below"`. caption position |
| `ratio` | string | named: `ratio:…` |  |
| `href` | string | named: `href:…` |  |
| `alt` | string | named: `alt:…` |  |
| `zoom` | flag | bare word: `zoom` | click opens a lightbox |
| `do` | action list | named: `do:…` | steps run on click |

## Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model's output do not change.

### React

```tsx
import { ui } from "@gistui/react/ui";

const lib = ui.extend({ Media: MyMedia });
<GistUI library={lib} stream={response.body} />;
```
### Vue

```vue
<GistUI :source="answer" :components="{ Media: MyMedia }" />
```
### Svelte

```svelte
<GistUI source={answer} components={{ Media: MyMedia }} />
```
### Solid

```tsx
<GistUI source={answer()} components={{ Media: MyMedia }} />
```
### Vanilla

```ts
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ Media: (ctx) => ({ el: myElement(ctx) }) });
```

See [Custom components](/docs/guides/custom-components/) for the full contract. Style hook: `[data-gistui="Media"]`.

Source: https://gistui.com/docs/components/content/media/index.mdx
