ColorModeAvatar

An Avatar with a different source for light and dark mode.

Usage

The ColorModeAvatar component extends the Avatar component, so you can pass any property such as size, icon, etc.

Use the light and dark props to define the source for light and dark mode.

 
<template>
  <UColorModeAvatar light="https://github.com/vuejs.png" dark="https://github.com/nuxt.png" />
</template>
Switch between light and dark mode to see the different images:

API

Props

Prop Default Type
as

'span'

any

The element or component this component should render as.

light

string

dark

string

size

"md" | "3xs" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"

delayMs

number

Useful for delaying rendering so it only appears for those with slower connections.

alt

string

icon

string

text

string

ui

Partial<{ root: string; image: string; fallback: string; icon: string; }>