+
+
diff --git a/docs/app/components/content/examples/dropdown-menu/DropdownMenuColorItemsExample.vue b/docs/app/components/content/examples/dropdown-menu/DropdownMenuColorItemsExample.vue
new file mode 100644
index 00000000..5e3f8273
--- /dev/null
+++ b/docs/app/components/content/examples/dropdown-menu/DropdownMenuColorItemsExample.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/content/3.components/context-menu.md b/docs/content/3.components/context-menu.md
index 190397ee..c1cec659 100644
--- a/docs/content/3.components/context-menu.md
+++ b/docs/content/3.components/context-menu.md
@@ -20,9 +20,11 @@ Use the `items` prop as an array of objects with the following properties:
- `label?: string`{lang="ts-type"}
- `icon?: string`{lang="ts-type"}
+- `color?: string`{lang="ts-type"}
- `avatar?: AvatarProps`{lang="ts-type"}
- `kbds?: string[] | KbdProps[]`{lang="ts-type"}
- [`type?: "link" | "label" | "separator" | "checkbox"`{lang="ts-type"}](#with-checkbox-items)
+- [`color?: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"`{lang="ts-type"}](#with-color-items)
- [`checked?: boolean`{lang="ts-type"}](#with-checkbox-items)
- `disabled?: boolean`{lang="ts-type"}
- `class?: any`{lang="ts-type"}
@@ -191,6 +193,16 @@ name: 'context-menu-checkbox-items-example'
To ensure reactivity for the `checked` state of items, it's recommended to wrap your `items` array inside a `computed`.
::
+### With color items
+
+You can use the `color` property to highlight certain items with a color.
+
+::component-example
+---
+name: 'context-menu-color-items-example'
+---
+::
+
### With custom slot
Use the `slot` property to customize a specific item.
diff --git a/docs/content/3.components/dropdown-menu.md b/docs/content/3.components/dropdown-menu.md
index 14137faf..25e8b910 100644
--- a/docs/content/3.components/dropdown-menu.md
+++ b/docs/content/3.components/dropdown-menu.md
@@ -20,9 +20,11 @@ Use the `items` prop as an array of objects with the following properties:
- `label?: string`{lang="ts-type"}
- `icon?: string`{lang="ts-type"}
+- `color?: string`{lang="ts-type"}
- `avatar?: AvatarProps`{lang="ts-type"}
- `kbds?: string[] | KbdProps[]`{lang="ts-type"}
- [`type?: "link" | "label" | "separator" | "checkbox"`{lang="ts-type"}](#with-checkbox-items)
+- [`color?: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"`{lang="ts-type"}](#with-color-items)
- [`checked?: boolean`{lang="ts-type"}](#with-checkbox-items)
- `disabled?: boolean`{lang="ts-type"}
- `class?: any`{lang="ts-type"}
@@ -273,6 +275,16 @@ name: 'dropdown-menu-checkbox-items-example'
To ensure reactivity for the `checked` state of items, it's recommended to wrap your `items` array inside a `computed`.
::
+### With color items
+
+You can use the `color` property to highlight certain items with a color.
+
+::component-example
+---
+name: 'dropdown-menu-color-items-example'
+---
+::
+
### Control open state
You can control the open state by using the `default-open` prop or the `v-model:open` directive.
diff --git a/playground/app/pages/components/context-menu.vue b/playground/app/pages/components/context-menu.vue
index 3afa2ed1..b811a9a7 100644
--- a/playground/app/pages/components/context-menu.vue
+++ b/playground/app/pages/components/context-menu.vue
@@ -86,6 +86,12 @@ const items = computed(() => [
}]
])
+const itemsWithColor = computed(() => Object.keys(theme.variants.color).map(color => ({
+ color: (color as keyof typeof theme.variants.color),
+ icon: 'i-heroicons-swatch',
+ label: color
+})))
+
const sizes = Object.keys(theme.variants.size)
const size = ref('md' as const)
@@ -104,5 +110,11 @@ defineShortcuts(extractShortcuts(items.value))
Right click here
+
+
+