The ColorModeSelect component extends the SelectMenu component, so you can pass any property such as color, variant, size, etc.
<template>
<UColorModeSelect />
</template>
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'
}
}
})
]
})
| Prop | Default | Type |
|---|---|---|
defaultOpen | boolean The open state of the combobox when it is initially rendered. | |
open | boolean The controlled open state of the Combobox. Can be binded with with | |
trailingIcon | appConfig.ui.icons.chevronDown | string | objectThe icon displayed to open the menu. |
color | 'primary' | "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" |
highlight | boolean Highlight the ring color like a focus state. | |
name | stringThe name of the field. Submitted with its owning form as part of a name/value pair. | |
trailing | boolean When | |
content | { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' } | ComboboxContentProps & Partial<EmitsToProps<DismissableLayerEmits>>The content of the menu.
|
loading | boolean When | |
size | 'md' | "md" | "xs" | "sm" | "lg" | "xl" |
avatar | AvatarPropsDisplay an avatar on the left side.
| |
variant | 'outline' | "ghost" | "outline" | "soft" | "subtle" | "none" |
autofocus | boolean | |
disabled | boolean When | |
leading | boolean When | |
leadingIcon | string | objectDisplay an icon on the left side. | |
loadingIcon | appConfig.ui.icons.loading | string | objectThe icon when the |
resetSearchTermOnBlur | `true` | boolean Whether to reset the searchTerm when the Combobox input blurred |
resetSearchTermOnSelect | `true` | boolean Whether to reset the searchTerm when the Combobox value is selected |
highlightOnHover | boolean When | |
defaultValue | null | string | number | bigint | false | true | { [key: string]: any; label?: string | undefined; description?: string | undefined; icon?: string | object | undefined; avatar?: AvatarProps | undefined; chip?: ChipProps | undefined; type?: "item" | "label" | "separator" | undefined; disabled?: boolean | undefined; onSelect?: ((e: Event) => void) | undefined; class?: any; ui?: Pick<{ base?: ClassNameValue; leading?: ClassNameValue; leadingIcon?: ClassNameValue; leadingAvatar?: ClassNameValue; leadingAvatarSize?: ClassNameValue; trailing?: ClassNameValue; trailingIcon?: ClassNameValue; value?: ClassNameValue; placeholder?: ClassNameValue; arrow?: ClassNameValue; content?: ClassNameValue; viewport?: ClassNameValue; group?: ClassNameValue; empty?: ClassNameValue; label?: ClassNameValue; separator?: ClassNameValue; item?: ClassNameValue; itemLeadingIcon?: ClassNameValue; itemLeadingAvatar?: ClassNameValue; itemLeadingAvatarSize?: ClassNameValue; itemLeadingChip?: ClassNameValue; itemLeadingChipSize?: ClassNameValue; itemTrailing?: ClassNameValue; itemTrailingIcon?: ClassNameValue; itemWrapper?: ClassNameValue; itemLabel?: ClassNameValue; itemDescription?: ClassNameValue; input?: ClassNameValue; focusScope?: ClassNameValue; }, "item" | "label" | "separator" | "itemLeadingIcon" | "itemLeadingAvatar" | "itemLeadingAvatarSize" | "itemLeadingChip" | "itemLeadingChipSize" | "itemTrailing" | "itemTrailingIcon" | "itemWrapper" | "itemLabel" | "itemDescription"> | undefined; }The value of the SelectMenu when initially rendered. Use when you do not need to control the state of the SelectMenu.
| |
multiple | falseWhether multiple options can be selected or not. | |
required | boolean | |
id | string | |
placeholder | stringThe placeholder text when the select is empty. | |
searchInput | false | boolean | InputProps<AcceptableValue> Whether to display the search input or not.
Can be an object to pass additional props to the input.
|
selectedIcon | appConfig.ui.icons.check | string | objectThe icon displayed when an item is selected. |
arrow | false | boolean | ComboboxArrowProps Display an arrow alongside the menu. |
portal | true | string | false | true | HTMLElementRender the menu in a portal. |
virtualize | false | boolean | { overscan?: number ; estimateSize?: number | undefined; } | undefinedEnable virtualization for large lists. Note: when enabled, all groups are flattened into a single list due to a limitation of Reka UI (https://github.com/unovue/reka-ui/issues/1885).
|
valueKey | undefined | undefinedWhen |
labelKey | 'label' | string | numberWhen |
descriptionKey | 'description' | string | numberWhen |
createItem | false | boolean | "always" | { position?: "top" | "bottom" ; when?: "empty" | "always" | undefined; } | undefinedDetermines if custom user input that does not exist in options can be added.
|
filterFields | [labelKey] | string[]Fields to filter items by. |
ignoreFilter | false | boolean When |
autofocusDelay | number | |
ui | { base?: ClassNameValue; leading?: ClassNameValue; leadingIcon?: ClassNameValue; leadingAvatar?: ClassNameValue; leadingAvatarSize?: ClassNameValue; trailing?: ClassNameValue; trailingIcon?: ClassNameValue; value?: ClassNameValue; placeholder?: ClassNameValue; arrow?: ClassNameValue; content?: ClassNameValue; viewport?: ClassNameValue; group?: ClassNameValue; empty?: ClassNameValue; label?: ClassNameValue; separator?: ClassNameValue; item?: ClassNameValue; itemLeadingIcon?: ClassNameValue; itemLeadingAvatar?: ClassNameValue; itemLeadingAvatarSize?: ClassNameValue; itemLeadingChip?: ClassNameValue; itemLeadingChipSize?: ClassNameValue; itemTrailing?: ClassNameValue; itemTrailingIcon?: ClassNameValue; itemWrapper?: ClassNameValue; itemLabel?: ClassNameValue; itemDescription?: ClassNameValue; input?: ClassNameValue; focusScope?: ClassNameValue; } |