---
title: "Icons and Images"
description: "How to use icons and images in your templates."
canonical_url: "https://nuxtseo.com/docs/og-image/guides/icons-and-images"
last_updated: "2026-05-15T23:17:52.049Z"
---

## Nuxt Icon & Nuxt UI

Nuxt OG Image supports both Nuxt Icon `Icon`'s component and Nuxt UI's `UIcon` component.

<code-group>

```vue [Nuxt Icon]
<template>
  <div>
    <Icon name="carbon:bot" mode="svg" />
  </div>
</template>
```

```vue [Nuxt UI]
<template>
  <div>
    <UIcon name="i-carbon-bot" mode="svg" />
  </div>
</template>
```

</code-group>

It's important that the `mode` is set to `svg` to ensure the module renders the icon correctly.

## Image Resolution

Image paths must be either relative to the `public` directory or absolute. It's not possible to bundle images
as part of your template.

## Tips

### Provide Width / Height

When you don't set dimensions, the module uses the package `image-size` to determine the best dimensions for your image.

However, this can be slow and provide incorrect results.

Therefore it's always recommended to provide a width and height when using images.

Likewise when using a background image, make sure the container has set dimensions.

### Base64 images Are Quickest

If you're having issues with performance and images, it's recommended to use base64 images.

This will save render time as it won't need to fetch the image. See the [Performance](/docs/og-image/guides/performance#optimise-components) guide for more tips.

### Avoid Inlining SVGs

Prefer rendering SVGs instead of inlining them within `img` tags

```html
<!-- ❌ -->
<img src="data:image/svg+xml;base64,..." />
<!-- ✅ -->
<svg>
  <rect width="24" height="24" />
</svg>
```
