You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can pass any property from the [Link](/components/link#props) component such as `to`, `target`, etc.
38
38
@@ -144,7 +144,7 @@ Each item can take a `children` array of objects with the following properties t
144
144
Use the `orientation` prop to change the orientation of the NavigationMenu.
145
145
146
146
::note
147
-
When orientation is `vertical`, a [Collapsible](/components/collapsible) component is used to display children. You can control the open state of each item using the `open` and `defaultOpen` properties.
147
+
When orientation is `vertical`, an [Accordion](/components/accordion) component is used to display each group. You can control the open state of each item using the `open` and `defaultOpen` properties and change the behavior using the [`collapsible`](/components/accordion#collapsible) and [`type`](/components/accordion#multiple) props.
148
148
::
149
149
150
150
::component-code
@@ -243,7 +243,11 @@ Groups will be spaced when orientation is `horizontal` and separated when orient
243
243
244
244
### Collapsed
245
245
246
-
Use the `collapsed` prop to collapse the NavigationMenu, this can be useful in a sidebar for example.
246
+
In `vertical` orientation, use the `collapsed` prop to collapse the NavigationMenu, this can be useful in a sidebar for example.
247
+
248
+
::note
249
+
You can use the [`tooltip`](#with-tooltip-in-items) and [`popover`](#with-popover-in-items) props to display more information on the collapsed items.
250
+
::
247
251
248
252
::component-code
249
253
---
@@ -256,8 +260,17 @@ external:
256
260
- items
257
261
externalTypes:
258
262
- NavigationMenuItem[][]
263
+
items:
264
+
tooltip:
265
+
- true
266
+
- false
267
+
popover:
268
+
- true
269
+
- false
259
270
props:
260
271
collapsed: true
272
+
tooltip: false
273
+
popover: false
261
274
orientation: 'vertical'
262
275
items:
263
276
- - label: Links
@@ -282,7 +295,6 @@ props:
282
295
description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
283
296
- label: Composables
284
297
icon: i-lucide-database
285
-
open: false
286
298
children:
287
299
- label: defineShortcuts
288
300
icon: i-lucide-file-text
@@ -298,7 +310,6 @@ props:
298
310
to: /composables/use-toast
299
311
- label: Components
300
312
icon: i-lucide-box
301
-
open: false
302
313
to: /components
303
314
active: true
304
315
children:
@@ -878,9 +889,11 @@ You can inspect the DOM to see each item's content being rendered.
878
889
879
890
## Examples
880
891
881
-
### With tooltips in items :badge{label="New"class="align-text-top"}
892
+
### With tooltip in items :badge{label="New"class="align-text-top"}
893
+
894
+
When orientation is `vertical` and the menu is `collapsed`, you can set the `tooltip` prop to `true` to display a [Tooltip](/components/tooltip) around items with their label but you can also use the `tooltip` property on each item to override the default tooltip.
882
895
883
-
You can use the `tooltip`property to display a [Tooltip](/components/tooltip)around an item. This can be useful when the menu is collapsed.
896
+
You can pass any property from the [Tooltip](/components/tooltip)component globally or on each item.
884
897
885
898
::component-code
886
899
---
@@ -893,47 +906,37 @@ external:
893
906
- items
894
907
externalTypes:
895
908
- NavigationMenuItem[][]
909
+
items:
910
+
tooltip:
911
+
- true
912
+
- false
896
913
props:
914
+
tooltip: true
897
915
collapsed: true
898
916
orientation: 'vertical'
899
917
items:
900
918
- - label: Links
901
919
type: 'label'
902
920
- label: Guide
903
921
icon: i-lucide-book-open
904
-
tooltip:
905
-
text: 'Guide'
906
922
children:
907
923
- label: Introduction
908
924
description: Fully styled and customizable components for Nuxt.
909
925
icon: i-lucide-house
910
-
tooltip:
911
-
text: 'Introduction'
912
926
- label: Installation
913
927
description: Learn how to install and configure Nuxt UI in your application.
914
928
icon: i-lucide-cloud-download
915
-
tooltip:
916
-
text: 'Installation'
917
929
- label: 'Icons'
918
930
icon: 'i-lucide-smile'
919
931
description: 'You have nothing to do, @nuxt/icon will handle it automatically.'
920
-
tooltip:
921
-
text: 'Icons'
922
932
- label: 'Colors'
923
933
icon: 'i-lucide-swatch-book'
924
934
description: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
925
-
tooltip:
926
-
text: 'Colors'
927
935
- label: 'Theme'
928
936
icon: 'i-lucide-cog'
929
937
description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
930
-
tooltip:
931
-
text: 'Theme'
932
938
- label: Composables
933
939
icon: i-lucide-database
934
-
tooltip:
935
-
text: 'Composables'
936
-
open: false
937
940
children:
938
941
- label: defineShortcuts
939
942
icon: i-lucide-file-text
@@ -949,11 +952,8 @@ props:
949
952
to: /composables/use-toast
950
953
- label: Components
951
954
icon: i-lucide-box
952
-
tooltip:
953
-
text: 'Components'
954
955
to: /components
955
956
active: true
956
-
open: false
957
957
children:
958
958
- label: Link
959
959
icon: i-lucide-file-text
@@ -985,17 +985,126 @@ props:
985
985
to: https://github.com/nuxt/ui
986
986
target: _blank
987
987
tooltip:
988
-
text: 'GitHub'
988
+
text: 'Open on GitHub'
989
989
kbds:
990
990
- 3.8k
991
991
- label: Help
992
992
icon: i-lucide-circle-help
993
993
disabled: true
994
+
---
995
+
::
996
+
997
+
### With popover in items :badge{label="Soon"class="align-text-top"}
998
+
999
+
When orientation is `vertical` and the menu is `collapsed`, you can set the `popover` prop to `true` to display a [Popover](/components/popover) around items with their children but you can also use the `popover` property on each item to override the default popover.
1000
+
1001
+
You can pass any property from the [Popover](/components/popover) component globally or on each item.
1002
+
1003
+
::component-code
1004
+
---
1005
+
collapse: true
1006
+
ignore:
1007
+
- items
1008
+
- orientation
1009
+
- class
1010
+
external:
1011
+
- items
1012
+
externalTypes:
1013
+
- NavigationMenuItem[][]
1014
+
items:
1015
+
popover:
1016
+
- true
1017
+
- false
1018
+
props:
1019
+
popover: true
1020
+
collapsed: true
1021
+
orientation: 'vertical'
1022
+
items:
1023
+
- - label: Links
1024
+
type: 'label'
1025
+
- label: Guide
1026
+
icon: i-lucide-book-open
1027
+
children:
1028
+
- label: Introduction
1029
+
description: Fully styled and customizable components for Nuxt.
1030
+
icon: i-lucide-house
1031
+
- label: Installation
1032
+
description: Learn how to install and configure Nuxt UI in your application.
1033
+
icon: i-lucide-cloud-download
1034
+
- label: 'Icons'
1035
+
icon: 'i-lucide-smile'
1036
+
description: 'You have nothing to do, @nuxt/icon will handle it automatically.'
1037
+
- label: 'Colors'
1038
+
icon: 'i-lucide-swatch-book'
1039
+
description: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
1040
+
- label: 'Theme'
1041
+
icon: 'i-lucide-cog'
1042
+
description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
1043
+
- label: Composables
1044
+
icon: i-lucide-database
1045
+
popover:
1046
+
mode: 'click'
1047
+
children:
1048
+
- label: defineShortcuts
1049
+
icon: i-lucide-file-text
1050
+
description: Define shortcuts for your application.
1051
+
to: /composables/define-shortcuts
1052
+
- label: useOverlay
1053
+
icon: i-lucide-file-text
1054
+
description: Display a modal/slideover within your application.
1055
+
to: /composables/use-overlay
1056
+
- label: useToast
1057
+
icon: i-lucide-file-text
1058
+
description: Display a toast within your application.
1059
+
to: /composables/use-toast
1060
+
- label: Components
1061
+
icon: i-lucide-box
1062
+
to: /components
1063
+
active: true
1064
+
children:
1065
+
- label: Link
1066
+
icon: i-lucide-file-text
1067
+
description: Use NuxtLink with superpowers.
1068
+
to: /components/link
1069
+
- label: Modal
1070
+
icon: i-lucide-file-text
1071
+
description: Display a modal within your application.
1072
+
to: /components/modal
1073
+
- label: NavigationMenu
1074
+
icon: i-lucide-file-text
1075
+
description: Display a list of links.
1076
+
to: /components/navigation-menu
1077
+
- label: Pagination
1078
+
icon: i-lucide-file-text
1079
+
description: Display a list of pages.
1080
+
to: /components/pagination
1081
+
- label: Popover
1082
+
icon: i-lucide-file-text
1083
+
description: Display a non-modal dialog that floats around a trigger element.
1084
+
to: /components/popover
1085
+
- label: Progress
1086
+
icon: i-lucide-file-text
1087
+
description: Show a horizontal bar to indicate task progression.
1088
+
to: /components/progress
1089
+
- - label: GitHub
1090
+
icon: i-simple-icons-github
1091
+
badge: 3.8k
1092
+
to: https://github.com/nuxt/ui
1093
+
target: _blank
994
1094
tooltip:
995
-
text: 'Help'
1095
+
text: 'Open on GitHub'
1096
+
kbds:
1097
+
- 3.8k
1098
+
- label: Help
1099
+
icon: i-lucide-circle-help
1100
+
disabled: true
996
1101
---
997
1102
::
998
1103
1104
+
::tip{to="#with-content-slot"}
1105
+
You can use the `#content` slot to customize the content of the popover in the `vertical` orientation.
1106
+
::
1107
+
999
1108
### Control active item
1000
1109
1001
1110
You can control the active item by using the `default-value` prop or the `v-model` directive with the index of the item.
@@ -1043,6 +1152,7 @@ Use the `#item-content` slot or the `slot` property (`#{{ item.slot }}-content`)
0 commit comments