ColorModélisation

GitHub à
Un élément d

Utilisation

Le composant ColorModeImage utilise le composant <NuxtImg> lorsque @nuxt/image est installé, revenant à img sinon.

<template>
  <UColorModeImage
    light="https://picsum.photos/id/29/400"
    dark="https://picsum.photos/id/46/400"
    :width="200"
    :height="200"
  />
</template>
Basculer entre le mode clair et sombre pour voir les différentes images: : u-color-mode-select{size="sm"}

api

Props

Prop Default Type
dark
string
light
string
alt
string
decoding
"async" | "auto" | "sync"
height
string | number
loading
"lazy" | "eager"
referrerpolicy
"" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"
sizes
string
srcset
string
usemap
string
width
string | number
crossorigin
"anonymous" | "use-credentials"
Ce composant prend également en charge tous les attributs HTML natifs <img>.

Changelog écrit

No recent changes