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 |
The open state of the combobox when it is initially rendered. | |
open |
The controlled open state of the Combobox. Can be binded with with | |
trailingIcon |
|
The icon displayed to open the menu. |
color |
|
|
highlight |
Highlight the ring color like a focus state. | |
name |
The name of the field. Submitted with its owning form as part of a name/value pair. | |
trailing |
When | |
content |
|
The content of the menu.
|
loading |
When | |
size |
|
|
avatar |
Display an avatar on the left side.
| |
variant |
|
|
autofocus |
| |
disabled |
When | |
form |
| |
formaction |
| |
formenctype |
| |
formmethod |
| |
formnovalidate |
| |
formtarget |
| |
value |
| |
leading |
When | |
leadingIcon |
Display an icon on the left side. | |
loadingIcon |
|
The icon when the |
resetSearchTermOnBlur |
Whether to reset the searchTerm when the Combobox input blurred | |
resetSearchTermOnSelect |
|
Whether to reset the searchTerm when the Combobox value is selected |
highlightOnHover |
When | |
defaultValue |
The value of the SelectMenu when initially rendered. Use when you do not need to control the state of the SelectMenu.
| |
multiple |
Whether multiple options can be selected or not. | |
required |
| |
id |
| |
placeholder |
The placeholder text when the select is empty. | |
searchInput |
|
Whether to display the search input or not.
Can be an object to pass additional props to the input.
|
selectedIcon |
|
The icon displayed when an item is selected. |
arrow |
|
Display an arrow alongside the menu. |
portal |
|
Render the menu in a portal. |
virtualize |
|
Enable 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 |
When | |
labelKey |
| When |
descriptionKey |
|
When |
createItem |
|
Determines if custom user input that does not exist in options can be added.
|
filterFields |
|
Fields to filter items by. |
ignoreFilter |
|
When |
autofocusDelay |
| |
ui |
|
5cb65 — feat: import @nuxt/ui-pro components