ColorModeSelect
Usage
The ColorModeSelect component extends the SelectMenu component, so you can pass any property such as color, variant, size, etc.
<template>
  <UColorModeSelect />
</template>
Examples
With custom icons
Use the app.config.ts to customize the icon with the ui.icons property:
export default defineAppConfig({
  ui: {
    icons: {
      system: 'i-ph-desktop',
      light: 'i-ph-sun',
      dark: 'i-ph-moon'
    }
  }
})
Use the vite.config.ts to customize the icon with the ui.icons property:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
  plugins: [
    vue(),
    ui({
      ui: {
        icons: {
          light: 'i-ph-sun',
          dark: 'i-ph-moon'
        }
      }
    })
  ]
})
API
Props
| Prop | Default | Type | 
|---|---|---|
trailingIcon | 
  | 
 The icon displayed to open the menu.  | 
color | 
  | 
  | 
content | 
  | 
 The content of the menu. 
  | 
size | 
  | 
  | 
disabled | 
 When   | |
variant | 
  | 
  | 
selectedIcon | 
  | 
 The icon displayed when an item is selected.  | 
arrow | 
  | 
 Display an arrow alongside the menu.  | 
portal | 
  | 
 Render the menu in a portal.  | 
ui | 
  |