# Generative UI: Media

> Preview images, icons, SVG, video, audio and sandboxed HTML.

Source: <https://everruns.com/docs/reference/generative-ui/media/>

Preview images, icons, SVG, video, audio and sandboxed HTML.

[All categories](https://everruns.com/docs/reference/generative-ui/)[Layout](https://everruns.com/docs/reference/generative-ui/layout/)[Text](https://everruns.com/docs/reference/generative-ui/text/)[Inputs](https://everruns.com/docs/reference/generative-ui/inputs/)[Data](https://everruns.com/docs/reference/generative-ui/data/)[Dynamic values](https://everruns.com/docs/reference/generative-ui/dynamic-values/)[Media](https://everruns.com/docs/reference/generative-ui/media/)[Composites](https://everruns.com/docs/reference/generative-ui/composites/)[Feedback](https://everruns.com/docs/reference/generative-ui/feedback/)

Try the controls and expand **A2UI example** for source. Actions display their message and values locally; no account or agent run is needed. Use **Reset** to start again. External maps and media load only when you select their load button.

No examples match. Try another component name or category.

Media

## Image, Icon, Favicon

`Image``Icon``Favicon`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-26",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Column",
        "gap": 3,
        "children": [
          "img",
          "variants",
          "row"
        ]
      },
      {
        "id": "img",
        "component": "Image",
        "url": "https://picsum.photos/seed/copilotkit/640/320",
        "description": "Sample photo",
        "aspectRatio": "2 / 1",
        "radius": "lg",
        "maxWidth": 480
      },
      {
        "id": "variants",
        "component": "Row",
        "wrap": "wrap",
        "gap": 3,
        "align": "center",
        "children": [
          "av",
          "ic",
          "sf",
          "vt"
        ]
      },
      {
        "id": "av",
        "component": "Image",
        "variant": "avatar",
        "url": "https://picsum.photos/seed/avatar/120/120",
        "description": "Avatar"
      },
      {
        "id": "ic",
        "component": "Image",
        "variant": "icon",
        "url": "https://picsum.photos/seed/icon/48/48",
        "description": "Icon-sized image"
      },
      {
        "id": "sf",
        "component": "Image",
        "variant": "smallFeature",
        "url": "https://picsum.photos/seed/small/320/240",
        "description": "Small feature"
      },
      {
        "id": "vt",
        "component": "Text",
        "text": "Image variants \"avatar\", \"icon\" and \"smallFeature\""
      },
      {
        "id": "row",
        "component": "Row",
        "gap": 3,
        "align": "center",
        "wrap": "wrap",
        "children": [
          "i1",
          "i2",
          "i3",
          "i4",
          "i5",
          "fav",
          "ft"
        ]
      },
      {
        "id": "i1",
        "component": "Icon",
        "name": "sparkles"
      },
      {
        "id": "i2",
        "component": "Icon",
        "name": "chart-bar",
        "size": "lg"
      },
      {
        "id": "i3",
        "component": "Icon",
        "name": "map-pin",
        "color": "danger"
      },
      {
        "id": "i4",
        "component": "Icon",
        "name": "shoppingCart"
      },
      {
        "id": "i5",
        "component": "Icon",
        "name": "favorite",
        "color": "danger"
      },
      {
        "id": "fav",
        "component": "Favicon",
        "url": "https://github.com",
        "size": 20
      },
      {
        "id": "ft",
        "component": "Text",
        "text": "Favicon of github.com"
      }
    ]
  }
}
```

Media

## Svg, Video, AudioPlayer, HtmlView

`Svg``Video``AudioPlayer``HtmlView`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-27",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Column",
        "gap": 3,
        "children": [
          "svg",
          "yt",
          "aud",
          "html"
        ]
      },
      {
        "id": "svg",
        "component": "Svg",
        "viewBox": "0 0 120 40",
        "width": 240,
        "height": 80,
        "circles": [
          {
            "cx": 20,
            "cy": 20,
            "r": 12,
            "fill": "info"
          }
        ],
        "rects": [
          {
            "x": 44,
            "y": 8,
            "width": 24,
            "height": 24,
            "rx": 4,
            "fill": "success"
          }
        ],
        "lines": [
          {
            "x1": 80,
            "y1": 32,
            "x2": 110,
            "y2": 8,
            "stroke": "danger"
          }
        ],
        "texts": [
          {
            "x": 60,
            "y": 38,
            "text": "svg",
            "size": 8,
            "anchor": "middle"
          }
        ]
      },
      {
        "id": "yt",
        "component": "Video",
        "url": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
        "title": "Sample flower video",
        "maxWidth": 480
      },
      {
        "id": "aud",
        "component": "AudioPlayer",
        "url": "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3",
        "description": "AudioPlayer: a short sample clip"
      },
      {
        "id": "html",
        "component": "HtmlView",
        "html": "<p style='font:14px system-ui;margin:8px'>Sandboxed <b>HTML</b> in an iframe.</p>",
        "height": 48,
        "title": "HtmlView"
      }
    ]
  }
}
```

Using these components in chat? See [Generative UI in chat](https://everruns.com/docs/features/generative-ui/) and [AG-UI support](https://everruns.com/docs/integrations/ag-ui/).

Examples adapted from the [CopilotKit standard catalog](https://docs.copilotkit.ai/generative-ui/components/standard-catalog), under the [MIT license](https://github.com/everruns/everruns/blob/main/apps/ui/generative-ui/COPILOTKIT-LICENSE).