nuxt/ui

Nuxt Image Integration, choosing NuxtImg or NuxtPicture for rendering

Closed this issue · 1 comments

Description

As stated in the Nuxt UI pro official documentation, when the Nuxt Image module is installed in the project, images in the markdown will be rendered using the NuxtImg component. However, according to the official Nuxt Image documentation, only the NuxtPicture component accepts global default values, such as:

  // nuxt.config.ts
  image: {
    format: ["avif", "webp"],
  },

This approach requires each image to be individually configured with a format or preset, which can cause usability issues. I'm not sure if there is a solution for this at the moment, but I hope that in the future, there will be a way for users to switch between rendering components easily.

Additional context

No response

Hey,

You can def set globally supposing you using IPX (and def with external providers as follows:

image: {
    provider: 'ipx',
    ipx: {
      modifiers: {
        quality: '80',
        format: 'webp',
      }
    }
  }