diff --git a/playground/app/pages/components/navigation-menu.vue b/playground/app/pages/components/navigation-menu.vue
index b514639c..8600042b 100644
--- a/playground/app/pages/components/navigation-menu.vue
+++ b/playground/app/pages/components/navigation-menu.vue
@@ -10,9 +10,13 @@ const highlightColor = ref()
const variant = ref(theme.defaultVariants.variant)
const orientation = ref('vertical' as const)
const highlight = ref(true)
+const collapsed = ref(false)
const items = [
[{
+ label: 'Link',
+ type: 'label' as const
+ }, {
label: 'Documentation',
icon: 'i-lucide-book-open',
badge: 10,
@@ -40,33 +44,33 @@ const items = [
defaultOpen: true,
children: [{
label: 'Link',
- icon: 'i-lucide-file',
+ icon: 'i-lucide-link',
description: 'Use NuxtLink with superpowers.',
to: '/components/link'
}, {
label: 'Modal',
- icon: 'i-lucide-file',
- description: 'Display a modal within your application.',
+ icon: 'i-lucide-square',
+ description: 'Display a modal dialog overlay for important content.',
to: '/components/modal'
}, {
label: 'NavigationMenu',
- icon: 'i-lucide-file',
+ icon: 'i-lucide-list',
description: 'Display a list of links.',
to: '/components/navigation-menu',
trailingIcon: 'i-lucide-check'
}, {
label: 'Pagination',
- icon: 'i-lucide-file',
+ icon: 'i-lucide-parking-meter',
description: 'Display a list of pages.',
to: '/components/pagination'
}, {
label: 'Popover',
- icon: 'i-lucide-file',
+ icon: 'i-lucide-message-circle',
description: 'Display a non-modal dialog that floats around a trigger element.',
to: '/components/popover'
}, {
label: 'Progress',
- icon: 'i-lucide-file',
+ icon: 'i-lucide-loader',
description: 'Show a horizontal bar to indicate task progression.',
to: '/components/progress'
}]
@@ -89,12 +93,14 @@ const items = [
+
diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue
index 2b4bed1e..6f5f71a8 100644
--- a/src/runtime/components/NavigationMenu.vue
+++ b/src/runtime/components/NavigationMenu.vue
@@ -61,6 +61,12 @@ export interface NavigationMenuProps extends Pick navigationMenu({
orientation: props.orientation,
+ collapsed: props.collapsed,
color: props.color,
variant: props.variant,
highlight: props.highlight,
@@ -190,7 +197,10 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]
-
+
{{ get(item, props.labelKey as string) }}
@@ -198,7 +208,7 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]
-
+
props.items?.length ? (Array.isArray(props.items[0]
-
+
) => ({
},
vertical: {
root: 'flex-col',
- link: 'flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0',
- childList: 'ms-5 border-s border-[var(--ui-border)]',
- childItem: 'ps-1.5 -ms-px'
+ link: 'flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0'
}
},
active: {
@@ -87,6 +85,9 @@ export default (options: Required) => ({
},
level: {
true: ''
+ },
+ collapsed: {
+ true: ''
}
},
compoundVariants: [{
@@ -216,6 +217,19 @@ export default (options: Required) => ({
class: {
link: 'after:bg-[var(--ui-bg-inverted)]'
}
+ }, {
+ orientation: 'vertical',
+ collapsed: false,
+ class: {
+ childList: 'ms-5 border-s border-[var(--ui-border)]',
+ childItem: 'ps-1.5 -ms-px'
+ }
+ }, {
+ orientation: 'vertical',
+ collapsed: true,
+ class: {
+ link: 'px-1.5'
+ }
}],
defaultVariants: {
color: 'primary',
diff --git a/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap b/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap
index e2589b99..7edce9f5 100644
--- a/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap
+++ b/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap
@@ -1,7 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`NavigationMenu > renders with arrow correctly 1`] = `
-"