@patternfly/react-docs 7.6.0-prerelease.7 → 7.6.0-prerelease.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/package.json +12 -13
  2. package/patternfly-docs/generated/components/about-modal/react.js +149 -0
  3. package/patternfly-docs/generated/components/accordion/react.js +262 -0
  4. package/patternfly-docs/generated/components/action-list/react.js +144 -0
  5. package/patternfly-docs/generated/components/alert/react-demos.js +56 -0
  6. package/patternfly-docs/generated/components/alert/react.js +1433 -0
  7. package/patternfly-docs/generated/components/avatar/react.js +166 -0
  8. package/patternfly-docs/generated/components/back-to-top/react-demos.js +60 -0
  9. package/patternfly-docs/generated/components/back-to-top/react.js +77 -0
  10. package/patternfly-docs/generated/components/backdrop/react.js +64 -0
  11. package/patternfly-docs/generated/components/background-image/react.js +62 -0
  12. package/patternfly-docs/generated/components/badge/react.js +97 -0
  13. package/patternfly-docs/generated/components/banner/react-demos.js +57 -0
  14. package/patternfly-docs/generated/components/banner/react.js +148 -0
  15. package/patternfly-docs/generated/components/brand/react.js +142 -0
  16. package/patternfly-docs/generated/components/breadcrumb/react.js +206 -0
  17. package/patternfly-docs/generated/components/button/react-demos.js +57 -0
  18. package/patternfly-docs/generated/components/button/react.js +826 -0
  19. package/patternfly-docs/generated/components/card/react-demos.js +201 -0
  20. package/patternfly-docs/generated/components/card/react.js +1015 -0
  21. package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +1350 -0
  22. package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +1334 -0
  23. package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +1282 -0
  24. package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +848 -0
  25. package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +192 -0
  26. package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +426 -0
  27. package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +804 -0
  28. package/patternfly-docs/generated/components/charts/legends/-Victory.js +3230 -0
  29. package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +1178 -0
  30. package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +525 -0
  31. package/patternfly-docs/generated/components/charts/patterns/-Victory.js +3382 -0
  32. package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +377 -0
  33. package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +2475 -0
  34. package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +538 -0
  35. package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +1551 -0
  36. package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +4115 -0
  37. package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +955 -0
  38. package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +1173 -0
  39. package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +1166 -0
  40. package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +413 -0
  41. package/patternfly-docs/generated/components/chip/react-deprecated.js +323 -0
  42. package/patternfly-docs/generated/components/clipboard-copy/react.js +373 -0
  43. package/patternfly-docs/generated/components/code-block/react.js +148 -0
  44. package/patternfly-docs/generated/components/code-editor/react.js +659 -0
  45. package/patternfly-docs/generated/components/compass/react-demos.js +147 -0
  46. package/patternfly-docs/generated/components/compass/react.js +440 -0
  47. package/patternfly-docs/generated/components/content/react.js +248 -0
  48. package/patternfly-docs/generated/components/data-list/react-demos.js +90 -0
  49. package/patternfly-docs/generated/components/data-list/react.js +709 -0
  50. package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +283 -0
  51. package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +64 -0
  52. package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +83 -0
  53. package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +395 -0
  54. package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +241 -0
  55. package/patternfly-docs/generated/components/description-list/react-demos.js +58 -0
  56. package/patternfly-docs/generated/components/description-list/react.js +743 -0
  57. package/patternfly-docs/generated/components/divider/react.js +126 -0
  58. package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +351 -0
  59. package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +184 -0
  60. package/patternfly-docs/generated/components/drag-and-drop/react.js +137 -0
  61. package/patternfly-docs/generated/components/drawer/react.js +598 -0
  62. package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +772 -0
  63. package/patternfly-docs/generated/components/dual-list-selector/react.js +594 -0
  64. package/patternfly-docs/generated/components/empty-state/react.js +199 -0
  65. package/patternfly-docs/generated/components/expandable-section/react-demos.js +65 -0
  66. package/patternfly-docs/generated/components/expandable-section/react.js +408 -0
  67. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +52 -0
  68. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +398 -0
  69. package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +749 -0
  70. package/patternfly-docs/generated/components/forms/checkbox/react.js +222 -0
  71. package/patternfly-docs/generated/components/forms/form/react.js +1106 -0
  72. package/patternfly-docs/generated/components/forms/form-select/react.js +208 -0
  73. package/patternfly-docs/generated/components/forms/radio/react.js +212 -0
  74. package/patternfly-docs/generated/components/forms/text-area/react.js +160 -0
  75. package/patternfly-docs/generated/components/forms/text-input/react.js +216 -0
  76. package/patternfly-docs/generated/components/helper-text/react-demos.js +180 -0
  77. package/patternfly-docs/generated/components/helper-text/react.js +164 -0
  78. package/patternfly-docs/generated/components/hero/react.js +88 -0
  79. package/patternfly-docs/generated/components/hint/react.js +169 -0
  80. package/patternfly-docs/generated/components/icon/react.js +215 -0
  81. package/patternfly-docs/generated/components/input-group/react.js +182 -0
  82. package/patternfly-docs/generated/components/jump-links/react-demos.js +154 -0
  83. package/patternfly-docs/generated/components/jump-links/react.js +212 -0
  84. package/patternfly-docs/generated/components/label/react-demos.js +57 -0
  85. package/patternfly-docs/generated/components/label/react.js +417 -0
  86. package/patternfly-docs/generated/components/list/react.js +175 -0
  87. package/patternfly-docs/generated/components/login-page/react.js +587 -0
  88. package/patternfly-docs/generated/components/masthead/react-demos.js +79 -0
  89. package/patternfly-docs/generated/components/masthead/react.js +291 -0
  90. package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +769 -0
  91. package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +665 -0
  92. package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +187 -0
  93. package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +163 -0
  94. package/patternfly-docs/generated/components/menus/dropdown/react.js +998 -0
  95. package/patternfly-docs/generated/components/menus/menu/react.js +1540 -0
  96. package/patternfly-docs/generated/components/menus/menu-toggle/react.js +747 -0
  97. package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +508 -0
  98. package/patternfly-docs/generated/components/menus/select/react-templates.js +257 -0
  99. package/patternfly-docs/generated/components/menus/select/react.js +998 -0
  100. package/patternfly-docs/generated/components/modal/react-deprecated.js +554 -0
  101. package/patternfly-docs/generated/components/modal/react.js +597 -0
  102. package/patternfly-docs/generated/components/navigation/react-demos.js +356 -0
  103. package/patternfly-docs/generated/components/navigation/react.js +409 -0
  104. package/patternfly-docs/generated/components/notification-badge/react.js +196 -0
  105. package/patternfly-docs/generated/components/notification-drawer/react-demos.js +107 -0
  106. package/patternfly-docs/generated/components/notification-drawer/react.js +394 -0
  107. package/patternfly-docs/generated/components/number-input/react.js +210 -0
  108. package/patternfly-docs/generated/components/overflow-menu/react.js +274 -0
  109. package/patternfly-docs/generated/components/page/react-demos.js +149 -0
  110. package/patternfly-docs/generated/components/page/react.js +1352 -0
  111. package/patternfly-docs/generated/components/pagination/react.js +492 -0
  112. package/patternfly-docs/generated/components/panel/react.js +236 -0
  113. package/patternfly-docs/generated/components/popover/react.js +390 -0
  114. package/patternfly-docs/generated/components/progress/react-demos.js +59 -0
  115. package/patternfly-docs/generated/components/progress/react.js +283 -0
  116. package/patternfly-docs/generated/components/progress-stepper/react-demos.js +45 -0
  117. package/patternfly-docs/generated/components/progress-stepper/react.js +219 -0
  118. package/patternfly-docs/generated/components/search-input/react-demos.js +113 -0
  119. package/patternfly-docs/generated/components/search-input/react.js +263 -0
  120. package/patternfly-docs/generated/components/sidebar/react.js +236 -0
  121. package/patternfly-docs/generated/components/simple-list/react.js +200 -0
  122. package/patternfly-docs/generated/components/skeleton/react-demos.js +44 -0
  123. package/patternfly-docs/generated/components/skeleton/react.js +122 -0
  124. package/patternfly-docs/generated/components/skip-to-content/react.js +73 -0
  125. package/patternfly-docs/generated/components/slider/react.js +309 -0
  126. package/patternfly-docs/generated/components/spinner/react.js +111 -0
  127. package/patternfly-docs/generated/components/switch/react.js +163 -0
  128. package/patternfly-docs/generated/components/table/react-demos.js +355 -0
  129. package/patternfly-docs/generated/components/table/react-deprecated.js +1350 -0
  130. package/patternfly-docs/generated/components/table/react.js +3241 -0
  131. package/patternfly-docs/generated/components/tabs/react-demos.js +108 -0
  132. package/patternfly-docs/generated/components/tabs/react.js +1359 -0
  133. package/patternfly-docs/generated/components/text-input-group/react-demos.js +152 -0
  134. package/patternfly-docs/generated/components/text-input-group/react.js +278 -0
  135. package/patternfly-docs/generated/components/tile/react-deprecated.js +242 -0
  136. package/patternfly-docs/generated/components/timestamp/react.js +283 -0
  137. package/patternfly-docs/generated/components/title/react.js +94 -0
  138. package/patternfly-docs/generated/components/toggle-group/react.js +299 -0
  139. package/patternfly-docs/generated/components/toolbar/react-demos.js +66 -0
  140. package/patternfly-docs/generated/components/toolbar/react.js +932 -0
  141. package/patternfly-docs/generated/components/tooltip/react.js +241 -0
  142. package/patternfly-docs/generated/components/tree-view/react.js +429 -0
  143. package/patternfly-docs/generated/components/truncate/react.js +211 -0
  144. package/patternfly-docs/generated/components/wizard/react-demos.js +87 -0
  145. package/patternfly-docs/generated/components/wizard/react-deprecated.js +788 -0
  146. package/patternfly-docs/generated/components/wizard/react.js +986 -0
  147. package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +285 -0
  148. package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +70 -0
  149. package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +506 -0
  150. package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +94 -0
  151. package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +272 -0
  152. package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +87 -0
  153. package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +124 -0
  154. package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +112 -0
  155. package/patternfly-docs/generated/index.js +1769 -0
  156. package/patternfly-docs/generated/patterns/card-view/react-demos.js +78 -0
  157. package/patternfly-docs/generated/patterns/filters/react-demos.js +141 -0
  158. package/patternfly-docs/generated/patterns/password-generator/react-demos.js +51 -0
  159. package/patternfly-docs/generated/patterns/password-strength/react-demos.js +61 -0
  160. package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +124 -0
  161. package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +81 -0
  162. package/LICENSE +0 -21
@@ -0,0 +1,1540 @@
1
+ import React from 'react';
2
+ import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
+ import { Fragment, createRef, useEffect, useRef, useState } from 'react';
4
+ import RhUiMenuBarsIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-menu-bars-icon';
5
+ import RhUiClipboardFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-clipboard-fill-icon';
6
+ import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
7
+ import RhUiServerStackFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-server-stack-fill-icon';
8
+ import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
9
+ import RhUiTableIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-table-icon';
10
+ import RhUiNotificationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-notification-fill-icon';
11
+ import RhUiStorageDomainFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-storage-domain-fill-icon';
12
+ import RhMicronsCaretLeftIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-left-icon';
13
+ import RhMicronsCaretDownIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-down-icon';
14
+ const pageData = {
15
+ "id": "Menu",
16
+ "section": "components",
17
+ "subsection": "menus",
18
+ "deprecated": false,
19
+ "template": false,
20
+ "beta": false,
21
+ "demo": false,
22
+ "newImplementationLink": false,
23
+ "source": "react",
24
+ "tabName": null,
25
+ "slug": "/components/menus/menu/react",
26
+ "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/Menu/examples/Menu.md",
27
+ "relPath": "packages/react-core/src/components/Menu/examples/Menu.md",
28
+ "propComponents": [
29
+ {
30
+ "name": "Menu",
31
+ "description": "",
32
+ "props": [
33
+ {
34
+ "name": "activeItemId",
35
+ "type": "string | number",
36
+ "description": "itemId of the currently active item. You can also specify isActive on the MenuItem."
37
+ },
38
+ {
39
+ "name": "activeMenu",
40
+ "type": "string",
41
+ "description": "ID of the currently active menu for the drilldown variant"
42
+ },
43
+ {
44
+ "name": "children",
45
+ "type": "React.ReactNode",
46
+ "description": "Anything that can be rendered inside of the Menu"
47
+ },
48
+ {
49
+ "name": "className",
50
+ "type": "string",
51
+ "description": "Additional classes added to the Menu"
52
+ },
53
+ {
54
+ "name": "containsDrilldown",
55
+ "type": "boolean",
56
+ "description": "Indicates if menu contains a drilldown menu"
57
+ },
58
+ {
59
+ "name": "containsFlyout",
60
+ "type": "boolean",
61
+ "description": "Indicates if menu contains a flyout menu"
62
+ },
63
+ {
64
+ "name": "drilldownItemPath",
65
+ "type": "string[]",
66
+ "description": "Indicates the path of drilled in menu itemIds"
67
+ },
68
+ {
69
+ "name": "drilledInMenus",
70
+ "type": "string[]",
71
+ "description": "Array of menus that are drilled in"
72
+ },
73
+ {
74
+ "name": "id",
75
+ "type": "string",
76
+ "description": "ID of the menu"
77
+ },
78
+ {
79
+ "name": "isMenuDrilledIn",
80
+ "type": "boolean",
81
+ "description": "Indicates if a menu is drilled into"
82
+ },
83
+ {
84
+ "name": "isNavFlyout",
85
+ "type": "boolean",
86
+ "description": "Indicating that the menu should have nav flyout styling"
87
+ },
88
+ {
89
+ "name": "isPlain",
90
+ "type": "boolean",
91
+ "description": "Indicates if the menu should be without the outer box-shadow"
92
+ },
93
+ {
94
+ "name": "isRootMenu",
95
+ "type": "boolean",
96
+ "description": "Internal flag indicating if the Menu is the root of a menu tree"
97
+ },
98
+ {
99
+ "name": "isScrollable",
100
+ "type": "boolean",
101
+ "description": "Indicates if the menu should be srollable"
102
+ },
103
+ {
104
+ "name": "onActionClick",
105
+ "type": "(event?: any, itemId?: any, actionId?: any) => void",
106
+ "description": "Callback called when an MenuItems's action button is clicked. You can also specify it within a MenuItemAction."
107
+ },
108
+ {
109
+ "name": "onDrillIn",
110
+ "type": "(\n event: React.KeyboardEvent | React.MouseEvent,\n fromItemId: string,\n toItemId: string,\n itemId: string\n) => void",
111
+ "description": "Callback for drilling into a submenu"
112
+ },
113
+ {
114
+ "name": "onDrillOut",
115
+ "type": "(event: React.KeyboardEvent | React.MouseEvent, toItemId: string, itemId: string) => void",
116
+ "description": "Callback for drilling out of a submenu"
117
+ },
118
+ {
119
+ "name": "onGetMenuHeight",
120
+ "type": "(menuId: string, height: number) => void",
121
+ "description": "Callback for collecting menu heights"
122
+ },
123
+ {
124
+ "name": "onSelect",
125
+ "type": "(event?: React.MouseEvent, itemId?: MenuItemProps['itemId']) => void",
126
+ "description": "Callback for updating when item selection changes. You can also specify onClick on the MenuItem."
127
+ },
128
+ {
129
+ "name": "ouiaId",
130
+ "type": "number | string",
131
+ "description": "Value to overwrite the randomly generated data-ouia-component-id."
132
+ },
133
+ {
134
+ "name": "ouiaSafe",
135
+ "type": "boolean",
136
+ "description": "Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false."
137
+ },
138
+ {
139
+ "name": "parentMenu",
140
+ "type": "string",
141
+ "description": "ID of parent menu for drilldown menus"
142
+ },
143
+ {
144
+ "name": "role",
145
+ "type": "string",
146
+ "description": "Determines the accessible role of the menu. For a non-checkbox menu that can have\none or more items selected, pass in \"listbox\"."
147
+ },
148
+ {
149
+ "name": "selected",
150
+ "type": "any | any[]",
151
+ "description": "Single itemId for single select menus, or array of itemIds for multi select. You can also specify isSelected on the MenuItem."
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "name": "MenuList",
157
+ "description": "",
158
+ "props": [
159
+ {
160
+ "name": "aria-label",
161
+ "type": "string",
162
+ "description": "Adds an accessible name to the menu."
163
+ },
164
+ {
165
+ "name": "children",
166
+ "type": "React.ReactNode",
167
+ "description": "Anything that can be rendered inside of menu list",
168
+ "defaultValue": "null"
169
+ },
170
+ {
171
+ "name": "className",
172
+ "type": "string",
173
+ "description": "Additional classes added to the menu list"
174
+ },
175
+ {
176
+ "name": "isAriaMultiselectable",
177
+ "type": "boolean",
178
+ "description": "Indicates to assistive technologies whether more than one item can be selected\nfor a non-checkbox menu. Only applies when the menu's role is \"listbox\".",
179
+ "defaultValue": "false"
180
+ }
181
+ ]
182
+ },
183
+ {
184
+ "name": "MenuItem",
185
+ "description": "",
186
+ "props": [
187
+ {
188
+ "name": "actions",
189
+ "type": "React.ReactNode",
190
+ "description": "Render item with one or more actions"
191
+ },
192
+ {
193
+ "name": "aria-label",
194
+ "type": "string",
195
+ "description": "Adds an accessible name to the menu item."
196
+ },
197
+ {
198
+ "name": "children",
199
+ "type": "React.ReactNode",
200
+ "description": "Content rendered inside the menu list item."
201
+ },
202
+ {
203
+ "name": "className",
204
+ "type": "string",
205
+ "description": "Additional classes added to the menu list item"
206
+ },
207
+ {
208
+ "name": "component",
209
+ "type": "React.ElementType<any> | React.ComponentType<any>",
210
+ "description": "Component used to render the menu item"
211
+ },
212
+ {
213
+ "name": "description",
214
+ "type": "React.ReactNode",
215
+ "description": "Description of the menu item"
216
+ },
217
+ {
218
+ "name": "direction",
219
+ "type": "'down' | 'up'",
220
+ "description": "Sub menu direction"
221
+ },
222
+ {
223
+ "name": "download",
224
+ "type": "string",
225
+ "description": "Navigation link download. Only set when the to property is present."
226
+ },
227
+ {
228
+ "name": "drilldownMenu",
229
+ "type": "React.ReactNode | (() => React.ReactNode)",
230
+ "description": "Drilldown menu of the item. Should be a Menu or DrilldownMenu type."
231
+ },
232
+ {
233
+ "name": "flyoutMenu",
234
+ "type": "React.ReactElement<any>",
235
+ "description": "Flyout menu. Should not be used if the to prop is defined."
236
+ },
237
+ {
238
+ "name": "hasCheckbox",
239
+ "type": "boolean",
240
+ "description": "Flag indicating the item has a checkbox"
241
+ },
242
+ {
243
+ "name": "icon",
244
+ "type": "React.ReactNode",
245
+ "description": "Render item with icon"
246
+ },
247
+ {
248
+ "name": "id",
249
+ "type": "string",
250
+ "description": "Sets the id attribute on the menu item component."
251
+ },
252
+ {
253
+ "name": "isActive",
254
+ "type": "boolean",
255
+ "description": "Flag indicating whether the item is active"
256
+ },
257
+ {
258
+ "name": "isAriaDisabled",
259
+ "type": "boolean",
260
+ "description": "Render item as aria-disabled option"
261
+ },
262
+ {
263
+ "name": "isDanger",
264
+ "type": "boolean",
265
+ "description": "Flag indicating the item is in danger state"
266
+ },
267
+ {
268
+ "name": "isDisabled",
269
+ "type": "boolean",
270
+ "description": "Render item as disabled option"
271
+ },
272
+ {
273
+ "name": "isExternalLink",
274
+ "type": "boolean",
275
+ "description": "Render an external link icon on focus or hover, and set the link's\n\"target\" attribute to a value of \"_blank\"."
276
+ },
277
+ {
278
+ "name": "isFavorited",
279
+ "type": "boolean",
280
+ "description": "Flag indicating if the item is favorited"
281
+ },
282
+ {
283
+ "name": "isFocused",
284
+ "type": "boolean",
285
+ "description": "Flag indicating the item is focused"
286
+ },
287
+ {
288
+ "name": "isLoadButton",
289
+ "type": "boolean",
290
+ "description": "Flag indicating if the item causes a load"
291
+ },
292
+ {
293
+ "name": "isLoading",
294
+ "type": "boolean",
295
+ "description": "Flag indicating a loading state"
296
+ },
297
+ {
298
+ "name": "isOnPath",
299
+ "type": "boolean",
300
+ "description": "True if item is on current selection path"
301
+ },
302
+ {
303
+ "name": "isSelected",
304
+ "type": "boolean",
305
+ "description": "Flag indicating if the option is selected"
306
+ },
307
+ {
308
+ "name": "itemId",
309
+ "type": "any",
310
+ "description": "Identifies the component in the Menu onSelect or onActionClick callback"
311
+ },
312
+ {
313
+ "name": "onClick",
314
+ "type": "(event?: any) => void",
315
+ "description": "Callback for item click"
316
+ },
317
+ {
318
+ "name": "onShowFlyout",
319
+ "type": "(event?: any) => void",
320
+ "description": "Callback function when mouse leaves trigger"
321
+ },
322
+ {
323
+ "name": "rel",
324
+ "type": "string",
325
+ "description": "Navigation link relationship. Only set when the to property is present."
326
+ },
327
+ {
328
+ "name": "target",
329
+ "type": "string",
330
+ "description": "Navigation link target. Only set when the to property is present. If isExternalLink is also passed in, this property will be set to \"_blank\"."
331
+ },
332
+ {
333
+ "name": "to",
334
+ "type": "string",
335
+ "description": "Target navigation link. Should not be used if the flyout prop is defined."
336
+ },
337
+ {
338
+ "name": "tooltipProps",
339
+ "type": "TooltipProps",
340
+ "description": "Props for adding a tooltip to a menu item"
341
+ }
342
+ ]
343
+ },
344
+ {
345
+ "name": "MenuItemAction",
346
+ "description": "",
347
+ "props": [
348
+ {
349
+ "name": "actionId",
350
+ "type": "any",
351
+ "description": "Identifies the action item in the onActionClick on the Menu"
352
+ },
353
+ {
354
+ "name": "aria-label",
355
+ "type": "string",
356
+ "description": "Accessibility label",
357
+ "required": true
358
+ },
359
+ {
360
+ "name": "className",
361
+ "type": "string",
362
+ "description": "Additional classes added to the action button"
363
+ },
364
+ {
365
+ "name": "icon",
366
+ "type": "'favorites' | React.ReactNode",
367
+ "description": "The action icon to use"
368
+ },
369
+ {
370
+ "name": "isDisabled",
371
+ "type": "boolean",
372
+ "description": "Disables action, can also be specified on the MenuItem instead"
373
+ },
374
+ {
375
+ "name": "isFavorited",
376
+ "type": "boolean",
377
+ "description": "Flag indicating if the item is favorited"
378
+ },
379
+ {
380
+ "name": "onClick",
381
+ "type": "(event?: any) => void",
382
+ "description": "Callback on action click, can also specify onActionClick on the Menu instead"
383
+ }
384
+ ]
385
+ },
386
+ {
387
+ "name": "MenuContent",
388
+ "description": "",
389
+ "props": [
390
+ {
391
+ "name": "children",
392
+ "type": "React.ReactNode",
393
+ "description": "Items within group"
394
+ },
395
+ {
396
+ "name": "getHeight",
397
+ "type": "(height: string) => void",
398
+ "description": "Callback to return the height of the menu content"
399
+ },
400
+ {
401
+ "name": "maxMenuHeight",
402
+ "type": "string",
403
+ "description": "Maximum height of menu content"
404
+ },
405
+ {
406
+ "name": "menuHeight",
407
+ "type": "string",
408
+ "description": "Height of the menu content"
409
+ }
410
+ ]
411
+ },
412
+ {
413
+ "name": "MenuSearch",
414
+ "description": "",
415
+ "props": [
416
+ {
417
+ "name": "children",
418
+ "type": "React.ReactNode",
419
+ "description": "Items within search"
420
+ }
421
+ ]
422
+ },
423
+ {
424
+ "name": "MenuSearchInput",
425
+ "description": "",
426
+ "props": [
427
+ {
428
+ "name": "children",
429
+ "type": "React.ReactNode",
430
+ "description": "Items within input"
431
+ }
432
+ ]
433
+ },
434
+ {
435
+ "name": "MenuGroup",
436
+ "description": "",
437
+ "props": [
438
+ {
439
+ "name": "children",
440
+ "type": "React.ReactNode",
441
+ "description": "Items within group"
442
+ },
443
+ {
444
+ "name": "className",
445
+ "type": "string",
446
+ "description": "Additional classes added to the MenuGroup"
447
+ },
448
+ {
449
+ "name": "label",
450
+ "type": "React.ReactNode",
451
+ "description": "Group label"
452
+ },
453
+ {
454
+ "name": "labelHeadingLevel",
455
+ "type": "'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
456
+ "description": "Group label heading level. Default is h1."
457
+ },
458
+ {
459
+ "name": "titleId",
460
+ "type": "string",
461
+ "description": "ID for title label"
462
+ }
463
+ ]
464
+ },
465
+ {
466
+ "name": "MenuContainer",
467
+ "description": "Container that links a menu and menu toggle together, to handle basic keyboard input and control the opening and closing of a menu.",
468
+ "props": [
469
+ {
470
+ "name": "focusTimeoutDelay",
471
+ "type": "number",
472
+ "description": "Time in ms to wait before firing the toggles' focus event. Defaults to 0",
473
+ "defaultValue": "0"
474
+ },
475
+ {
476
+ "name": "isOpen",
477
+ "type": "boolean",
478
+ "description": "Flag to indicate if menu is opened.",
479
+ "required": true
480
+ },
481
+ {
482
+ "name": "menu",
483
+ "type": "React.ReactElement<any, string | React.JSXElementConstructor<any>>",
484
+ "description": "Menu to be rendered",
485
+ "required": true
486
+ },
487
+ {
488
+ "name": "menuRef",
489
+ "type": "React.RefObject<any>",
490
+ "description": "Reference to the menu",
491
+ "required": true
492
+ },
493
+ {
494
+ "name": "onOpenChange",
495
+ "type": "(isOpen: boolean) => void",
496
+ "description": "Callback to change the open state of the menu.\nTriggered by clicking outside of the menu, or by pressing any keys specified in onOpenChangeKeys."
497
+ },
498
+ {
499
+ "name": "onOpenChangeKeys",
500
+ "type": "string[]",
501
+ "description": "Keys that trigger onOpenChange, defaults to tab and escape. It is highly recommended to include Escape in the array, while Tab may be omitted if the menu contains non-menu items that are focusable.",
502
+ "defaultValue": "['Escape', 'Tab']"
503
+ },
504
+ {
505
+ "name": "onToggleKeydown",
506
+ "type": "(event: KeyboardEvent) => void",
507
+ "description": "Callback to override the toggle keydown behavior. By default, when the toggle has focus and the menu is open, pressing the up/down arrow keys will focus a valid non-disabled menu item - the first item for the down arrow key and last item for the up arrow key."
508
+ },
509
+ {
510
+ "name": "popperProps",
511
+ "type": "PopperOptions",
512
+ "description": "Additional properties to pass to the Popper"
513
+ },
514
+ {
515
+ "name": "shouldFocusFirstItemOnOpen",
516
+ "type": "boolean",
517
+ "description": "Flag indicating the first menu item should be focused after opening the dropdown.",
518
+ "defaultValue": "false",
519
+ "beta": true
520
+ },
521
+ {
522
+ "name": "shouldPreventScrollOnItemFocus",
523
+ "type": "boolean",
524
+ "description": "Flag indicating if scroll on focus of the first menu item should occur.",
525
+ "defaultValue": "true"
526
+ },
527
+ {
528
+ "name": "toggle",
529
+ "type": "React.ReactNode",
530
+ "description": "Toggle to be rendered",
531
+ "required": true
532
+ },
533
+ {
534
+ "name": "toggleRef",
535
+ "type": "React.RefObject<any>",
536
+ "description": "Reference to the toggle",
537
+ "required": true
538
+ },
539
+ {
540
+ "name": "zIndex",
541
+ "type": "number",
542
+ "description": "z-index of the dropdown menu",
543
+ "defaultValue": "9999"
544
+ }
545
+ ]
546
+ },
547
+ {
548
+ "name": "TooltipProps",
549
+ "description": "",
550
+ "props": [
551
+ {
552
+ "name": "animationDuration",
553
+ "type": "number",
554
+ "description": "CSS fade transition animation duration"
555
+ },
556
+ {
557
+ "name": "appendTo",
558
+ "type": "HTMLElement | ((ref?: HTMLElement) => HTMLElement)",
559
+ "description": "The element to append the tooltip to, defaults to body"
560
+ },
561
+ {
562
+ "name": "aria",
563
+ "type": "'describedby' | 'labelledby' | 'none'",
564
+ "description": "aria-labelledby or aria-describedby for tooltip.\nThe trigger will be cloned to add the aria attribute, and the corresponding id in the form of 'pf-tooltip-#' is added to the content container.\nIf you don't want that or prefer to add the aria attribute yourself on the trigger, set aria to 'none'."
565
+ },
566
+ {
567
+ "name": "children",
568
+ "type": "ReactElement<any>",
569
+ "description": "The trigger reference element to which the Tooltip is relatively placed to.\nIf you cannot wrap the element with the Tooltip, you can use the triggerRef prop instead.\nUsage: <Tooltip><Button>Reference</Button></Tooltip>"
570
+ },
571
+ {
572
+ "name": "className",
573
+ "type": "string",
574
+ "description": "Tooltip additional class"
575
+ },
576
+ {
577
+ "name": "content",
578
+ "type": "React.ReactNode",
579
+ "description": "Tooltip content",
580
+ "required": true
581
+ },
582
+ {
583
+ "name": "distance",
584
+ "type": "number",
585
+ "description": "Distance of the tooltip to its target, defaults to 15"
586
+ },
587
+ {
588
+ "name": "enableFlip",
589
+ "type": "boolean",
590
+ "description": "If true, tries to keep the tooltip in view by flipping it if necessary"
591
+ },
592
+ {
593
+ "name": "entryDelay",
594
+ "type": "number",
595
+ "description": "Delay in ms before the tooltip appears"
596
+ },
597
+ {
598
+ "name": "exitDelay",
599
+ "type": "number",
600
+ "description": "Delay in ms before the tooltip disappears, Avoid passing in a value of \"0\", as users should\nbe given ample time to move their mouse from the trigger to the tooltip content without the content\nbeing hidden."
601
+ },
602
+ {
603
+ "name": "flipBehavior",
604
+ "type": "| 'flip'\n | (\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end'\n )[]",
605
+ "description": "The desired position to flip the tooltip to if the initial position is not possible.\nBy setting this prop to 'flip' it attempts to flip the tooltip to the opposite side if there is no space.\nYou can also pass an array of positions that determines the flip order. It should contain the initial position\nfollowed by alternative positions if that position is unavailable.\nExample: Initial position is 'top'. Button with tooltip is in the top right corner. 'flipBehavior' is set to\n['top', 'right', 'left']. Since there is no space to the top, it checks if right is available. There's also no\nspace to the right, so it finally shows the tooltip on the left."
606
+ },
607
+ {
608
+ "name": "id",
609
+ "type": "string",
610
+ "description": "id of the tooltip"
611
+ },
612
+ {
613
+ "name": "isContentLeftAligned",
614
+ "type": "boolean",
615
+ "description": "Flag to indicate that the text content is left aligned"
616
+ },
617
+ {
618
+ "name": "isVisible",
619
+ "type": "boolean",
620
+ "description": "value for visibility when trigger is 'manual'"
621
+ },
622
+ {
623
+ "name": "maxWidth",
624
+ "type": "string",
625
+ "description": "Maximum width of the tooltip (default 18.75rem)"
626
+ },
627
+ {
628
+ "name": "minWidth",
629
+ "type": "string | 'trigger'",
630
+ "description": "Minimum width of the tooltip. If set to \"trigger\", the minimum width will be set to the reference element width."
631
+ },
632
+ {
633
+ "name": "onTooltipHidden",
634
+ "type": "() => void",
635
+ "description": "Callback when tooltip's hide transition has finished executing"
636
+ },
637
+ {
638
+ "name": "position",
639
+ "type": "| TooltipPosition\n | 'auto'\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end'",
640
+ "description": "Tooltip position. Note: With 'enableFlip' set to true,\nit will change the position if there is not enough space for the starting position.\nThe behavior of where it flips to can be controlled through the flipBehavior prop.\nThe 'auto' position chooses the side with the most space.\nThe 'auto' position requires the 'enableFlip' prop to be true."
641
+ },
642
+ {
643
+ "name": "trigger",
644
+ "type": "string",
645
+ "description": "Tooltip trigger: click, mouseenter, focus, manual\nSet to manual to trigger tooltip programmatically (through the isVisible prop)"
646
+ },
647
+ {
648
+ "name": "triggerRef",
649
+ "type": "HTMLElement | (() => HTMLElement) | React.RefObject<any>",
650
+ "description": "The trigger reference element to which the Tooltip is relatively placed to.\nIf you can wrap the element with the Tooltip, you can use the children prop instead, or both props together.\nWhen passed along with the trigger prop, the div element that wraps the trigger will be removed.\nUsage: <Tooltip triggerRef={() => document.getElementById('reference-element')} />"
651
+ },
652
+ {
653
+ "name": "Unknown",
654
+ "type": "'off' | 'polite'",
655
+ "description": "Determines whether the tooltip is an aria-live region. If the triggerRef prop is passed in the\ndefault behavior is 'polite' in order to ensure the tooltip contents is announced to\nassistive technologies. Otherwise the default behavior is 'off'."
656
+ },
657
+ {
658
+ "name": "zIndex",
659
+ "type": "number",
660
+ "description": "z-index of the tooltip"
661
+ }
662
+ ]
663
+ },
664
+ {
665
+ "name": "PopperOptions",
666
+ "description": "Properties of Popper that can be used to customize its behavior.",
667
+ "props": [
668
+ {
669
+ "name": "animationDuration",
670
+ "type": "number",
671
+ "description": "The duration of the CSS fade transition animation."
672
+ },
673
+ {
674
+ "name": "appendTo",
675
+ "type": "HTMLElement | (() => HTMLElement) | 'inline'",
676
+ "description": "The container to append the popper to. Defaults to 'inline'."
677
+ },
678
+ {
679
+ "name": "direction",
680
+ "type": "'up' | 'down'",
681
+ "description": "popper direction"
682
+ },
683
+ {
684
+ "name": "distance",
685
+ "type": "number",
686
+ "description": "Distance of the popper to the trigger"
687
+ },
688
+ {
689
+ "name": "enableFlip",
690
+ "type": "boolean",
691
+ "description": "Enable to flip the popper when it reaches the boundary"
692
+ },
693
+ {
694
+ "name": "entryDelay",
695
+ "type": "number",
696
+ "description": "Delay in ms before the popper appears"
697
+ },
698
+ {
699
+ "name": "exitDelay",
700
+ "type": "number",
701
+ "description": "Delay in ms before the popper disappears"
702
+ },
703
+ {
704
+ "name": "flipBehavior",
705
+ "type": "| 'flip'\n | (\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end'\n )[]",
706
+ "description": "The behavior of how the popper flips when it reaches the boundary"
707
+ },
708
+ {
709
+ "name": "maxWidth",
710
+ "type": "string | 'trigger'",
711
+ "description": "Maximum width of the popper. If the value is \"trigger\", it will set the max width to the trigger element's width"
712
+ },
713
+ {
714
+ "name": "minWidth",
715
+ "type": "string | 'trigger'",
716
+ "description": "Minimum width of the popper. If the value is \"trigger\", it will set the min width to the trigger element's width"
717
+ },
718
+ {
719
+ "name": "offset",
720
+ "type": "OffsetOptions['offset']",
721
+ "description": "Override for the popper's offset"
722
+ },
723
+ {
724
+ "name": "onBlur",
725
+ "type": "(event?: FocusEvent) => void",
726
+ "description": "Callback function when trigger is blurred (focus leaves)"
727
+ },
728
+ {
729
+ "name": "onDocumentClick",
730
+ "type": "(event?: MouseEvent, triggerElement?: HTMLElement, popperElement?: HTMLElement) => void",
731
+ "description": "Callback function when document is clicked"
732
+ },
733
+ {
734
+ "name": "onDocumentKeyDown",
735
+ "type": "(event?: KeyboardEvent) => void",
736
+ "description": "Callback function when keydown event occurs on document"
737
+ },
738
+ {
739
+ "name": "onFocus",
740
+ "type": "(event?: FocusEvent) => void",
741
+ "description": "Callback function when trigger is focused"
742
+ },
743
+ {
744
+ "name": "onHidden",
745
+ "type": "() => void",
746
+ "description": "Callback when popper's hide transition has finished executing"
747
+ },
748
+ {
749
+ "name": "onHide",
750
+ "type": "() => void",
751
+ "description": "Lifecycle function invoked when the popper begins to transition out."
752
+ },
753
+ {
754
+ "name": "onMount",
755
+ "type": "() => void",
756
+ "description": "Lifecycle function invoked when the popper has been mounted to the DOM."
757
+ },
758
+ {
759
+ "name": "onMouseEnter",
760
+ "type": "(event?: MouseEvent) => void",
761
+ "description": "Callback function when mouse enters trigger"
762
+ },
763
+ {
764
+ "name": "onMouseLeave",
765
+ "type": "(event?: MouseEvent) => void",
766
+ "description": "Callback function when mouse leaves trigger"
767
+ },
768
+ {
769
+ "name": "onPopperClick",
770
+ "type": "(event?: MouseEvent) => void",
771
+ "description": "Callback function when popper is clicked"
772
+ },
773
+ {
774
+ "name": "onPopperMouseEnter",
775
+ "type": "(event?: MouseEvent) => void",
776
+ "description": "Callback function when mouse enters popper content"
777
+ },
778
+ {
779
+ "name": "onPopperMouseLeave",
780
+ "type": "(event?: MouseEvent) => void",
781
+ "description": "Callback function when mouse leaves popper content"
782
+ },
783
+ {
784
+ "name": "onShow",
785
+ "type": "() => void",
786
+ "description": "Lifecycle function invoked when the popper begins to transition in."
787
+ },
788
+ {
789
+ "name": "onShown",
790
+ "type": "() => void",
791
+ "description": "Lifecycle function invoked when the popper has fully transitioned in."
792
+ },
793
+ {
794
+ "name": "onTriggerClick",
795
+ "type": "(event?: MouseEvent) => void",
796
+ "description": "Callback function when trigger is clicked"
797
+ },
798
+ {
799
+ "name": "onTriggerEnter",
800
+ "type": "(event?: KeyboardEvent) => void",
801
+ "description": "Callback function when Enter key is used on trigger"
802
+ },
803
+ {
804
+ "name": "placement",
805
+ "type": "Placement",
806
+ "description": "Instead of direction and position can set the placement of the popper"
807
+ },
808
+ {
809
+ "name": "position",
810
+ "type": "'right' | 'left' | 'center' | 'start' | 'end'",
811
+ "description": "Horizontal position of the popper. Use the additional prop preventOverflow if seeing clipping."
812
+ },
813
+ {
814
+ "name": "positionModifiers",
815
+ "type": "{\n top?: string;\n right?: string;\n bottom?: string;\n left?: string;\n topStart?: string;\n topEnd?: string;\n bottomStart?: string;\n bottomEnd?: string;\n leftStart?: string;\n leftEnd?: string;\n rightStart?: string;\n rightEnd?: string;\n }",
816
+ "description": "Map class names to positions, for example:\n{\n top: styles.modifiers.top,\n bottom: styles.modifiers.bottom,\n left: styles.modifiers.left,\n right: styles.modifiers.right\n}"
817
+ },
818
+ {
819
+ "name": "preventOverflow",
820
+ "type": "boolean",
821
+ "description": "Flag to prevent the popper from overflowing its container and becoming partially obscured."
822
+ },
823
+ {
824
+ "name": "width",
825
+ "type": "string | 'trigger'",
826
+ "description": "Custom width of the popper. If the value is \"trigger\", it will set the width to the trigger element's width"
827
+ },
828
+ {
829
+ "name": "zIndex",
830
+ "type": "number",
831
+ "description": "z-index of the popper element"
832
+ }
833
+ ]
834
+ }
835
+ ],
836
+ "cssPrefix": [
837
+ "pf-v6-c-menu"
838
+ ],
839
+ "examples": [
840
+ "Basic menus",
841
+ "Danger menu item",
842
+ "With icons",
843
+ "With actions",
844
+ "With links",
845
+ "With descriptions",
846
+ "Item checkbox",
847
+ "Menu footer",
848
+ "Separated items",
849
+ "Titled groups of items",
850
+ "With favorites",
851
+ "Filtering with search input",
852
+ "Option single select menu",
853
+ "Option multi select menu",
854
+ "Scrollable menus",
855
+ "Scrollable menu with custom height",
856
+ "With view more",
857
+ "With drilldown",
858
+ "Initially drilled-in menu",
859
+ "With drilldown - submenu functions",
860
+ "With drilldown breadcrumbs",
861
+ "With drilldown and inline filter"
862
+ ]
863
+ };
864
+ pageData.liveContext = {
865
+ Fragment,
866
+ createRef,
867
+ useEffect,
868
+ useRef,
869
+ useState,
870
+ RhUiMenuBarsIcon,
871
+ RhUiClipboardFillIcon,
872
+ RhUiBranchFillIcon,
873
+ RhUiServerStackFillIcon,
874
+ CubeIcon,
875
+ RhUiTableIcon,
876
+ RhUiNotificationFillIcon,
877
+ RhUiStorageDomainFillIcon,
878
+ RhMicronsCaretLeftIcon,
879
+ RhMicronsCaretDownIcon
880
+ };
881
+ pageData.examples = {
882
+ 'Basic menus': props =>
883
+ <Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem, Checkbox } from '@patternfly/react-core';\n\nexport const MenuBasic: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n const [isPlain, setIsPlain] = useState(false);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number; // eslint-disable-next-line no-console\n console.log(`clicked ${itemId}`);\n setActiveItem(item);\n };\n\n const togglePlain = (checked: boolean) => {\n setIsPlain(checked);\n };\n\n return (\n <Fragment>\n <Menu activeItemId={activeItem} onSelect={onSelect} isPlain={isPlain}>\n <MenuContent>\n <MenuList>\n <MenuItem itemId={0}>Action</MenuItem>\n <MenuItem\n itemId={1}\n to=\"#default-link2\"\n // just for demo so that navigation is not triggered\n onClick={(event) => event.preventDefault()}\n >\n Link\n </MenuItem>\n <MenuItem isDisabled>Disabled action</MenuItem>\n <MenuItem isDisabled to=\"#default-link4\">\n Disabled link\n </MenuItem>\n <MenuItem isAriaDisabled tooltipProps={{ content: 'aria-disabled action', position: 'top' }}>\n Aria-disabled action\n </MenuItem>\n <MenuItem\n isAriaDisabled\n to=\"#default-link5\"\n tooltipProps={{ content: 'aria-disabled link', position: 'top' }}\n >\n Aria-disabled link\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n <div style={{ marginTop: 20 }}>\n <Checkbox\n label=\"Plain menu\"\n isChecked={isPlain}\n onChange={(_event, checked) => togglePlain(checked)}\n aria-label=\"plain menu checkbox\"\n id=\"toggle-plain\"\n name=\"toggle-plain\"\n />\n </div>\n </Fragment>\n );\n};\n","title":"Basic menus","lang":"ts","className":""}}>
884
+
885
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
886
+ {`A menu may contain multiple variations of `}
887
+
888
+ <code {...{"className":"ws-code "}}>
889
+ {`<MenuItem>`}
890
+ </code>
891
+ {` components. The following example shows a few different states of menu items, where they may:`}
892
+ </p>
893
+
894
+ <ul {...{"className":"pf-v6-c-content--ul pf-m-editorial ws-ul "}}>
895
+
896
+
897
+
898
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
899
+ {`Use the `}
900
+
901
+ <code {...{"className":"ws-code "}}>
902
+ {`itemId`}
903
+ </code>
904
+ {` property to link to callbacks. In this example, the `}
905
+
906
+ <code {...{"className":"ws-code "}}>
907
+ {`onSelect`}
908
+ </code>
909
+ {` property logs information to the console when a menu item is selected. In practice, specific actions can be linked to `}
910
+
911
+ <code {...{"className":"ws-code "}}>
912
+ {`onSelect`}
913
+ </code>
914
+ {` callbacks.`}
915
+ </li>
916
+
917
+
918
+
919
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
920
+ {`Use the `}
921
+
922
+ <code {...{"className":"ws-code "}}>
923
+ {`to`}
924
+ </code>
925
+ {` property to direct users to other resources or webpages after selecting a menu item, and the `}
926
+
927
+ <code {...{"className":"ws-code "}}>
928
+ {`onClick`}
929
+ </code>
930
+ {` property to pass in a callback for specific menu items.`}
931
+ </li>
932
+
933
+
934
+
935
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
936
+ {`Use the `}
937
+
938
+ <code {...{"className":"ws-code "}}>
939
+ {`isDisabled`}
940
+ </code>
941
+ {` property to disable a menu item.`}
942
+ </li>
943
+
944
+
945
+
946
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
947
+ {`Use the `}
948
+
949
+ <code {...{"className":"ws-code "}}>
950
+ {`isPlain`}
951
+ </code>
952
+ {` property to remove the outer box shadow and style the menu plainly instead.`}
953
+ </li>
954
+
955
+
956
+ </ul>
957
+ </Example>,
958
+ 'Danger menu item': props =>
959
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Divider, Menu, MenuContent, MenuItem, MenuList } from '@patternfly/react-core';\n\nexport const MenuDangerMenuItem: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number;\n // eslint-disable-next-line no-console\n console.log(`clicked ${itemId}`);\n setActiveItem(item);\n };\n\n return (\n <Menu activeItemId={activeItem} onSelect={onSelect}>\n <MenuContent>\n <MenuList>\n <MenuItem itemId={0}>Action 1</MenuItem>\n <MenuItem itemId={1}>Action 2</MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId={2} isDanger>\n Delete\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Danger menu item","lang":"ts","className":""}}>
960
+
961
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
962
+ {`To indicate that a `}
963
+
964
+ <code {...{"className":"ws-code "}}>
965
+ {`<MenuItem>`}
966
+ </code>
967
+ {` is connected to a potentially destructive action, use the `}
968
+
969
+ <code {...{"className":"ws-code "}}>
970
+ {`isDanger`}
971
+ </code>
972
+ {` property. The "Delete" item in the following example demonstrates how danger items look.`}
973
+ </p>
974
+ </Example>,
975
+ 'With icons': props =>
976
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\nimport RhUiServerStackFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-server-stack-fill-icon';\nimport CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';\n\nexport const MenuWithIcons: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number; // eslint-disable-next-line no-console\n console.log(`clicked ${item}`);\n setActiveItem(item);\n };\n\n return (\n <Menu onSelect={onSelect} activeItemId={activeItem}>\n <MenuContent>\n <MenuList>\n <MenuItem icon={<RhUiBranchFillIcon />} itemId={0}>\n From git\n </MenuItem>\n <MenuItem icon={<RhUiServerStackFillIcon />} itemId={1}>\n Container image\n </MenuItem>\n <MenuItem icon={<CubeIcon />} itemId={2}>\n Docker file\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With icons","lang":"ts","className":""}}>
977
+
978
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
979
+ {`Use the `}
980
+
981
+ <code {...{"className":"ws-code "}}>
982
+ {`icon`}
983
+ </code>
984
+ {` property to add a familiar icon before a `}
985
+
986
+ <code {...{"className":"ws-code "}}>
987
+ {`<MenuItem>`}
988
+ </code>
989
+ {` to accelerate text label recognition.`}
990
+ </p>
991
+ </Example>,
992
+ 'With actions': props =>
993
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuGroup, MenuList, MenuItem, MenuItemAction } from '@patternfly/react-core';\nimport RhUiMenuBarsIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-menu-bars-icon';\nimport RhUiClipboardFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-clipboard-fill-icon';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\nimport RhUiNotificationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-notification-fill-icon';\n\nexport const MenuWithActions: React.FunctionComponent = () => {\n const [selectedItems, setSelectedItems] = useState<number[]>([0, 2, 3]);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number;\n if (selectedItems.indexOf(item) !== -1) {\n setSelectedItems(selectedItems.filter((id) => id !== item));\n } else {\n setSelectedItems([...selectedItems, item]);\n }\n };\n\n return (\n <Menu\n onSelect={onSelect}\n // eslint-disable-next-line no-console\n onActionClick={(_event, itemId, actionId) => console.log(`clicked on ${itemId} - ${actionId}`)}\n activeItemId={0}\n >\n <MenuContent>\n <MenuGroup label=\"Actions\" labelHeadingLevel=\"h3\">\n <MenuList>\n <MenuItem\n isSelected={selectedItems.indexOf(0) !== -1}\n actions={\n <MenuItemAction\n icon={<RhUiBranchFillIcon />}\n actionId=\"code\"\n // eslint-disable-next-line no-console\n onClick={() => console.log('clicked on code icon')}\n aria-label=\"Code\"\n />\n }\n description=\"This is a description\"\n itemId={0}\n >\n Item 1\n </MenuItem>\n <MenuItem\n isDisabled\n isSelected={selectedItems.indexOf(1) !== -1}\n actions={<MenuItemAction icon={<RhUiNotificationFillIcon />} actionId=\"alert\" aria-label=\"Alert\" />}\n description=\"This is a description\"\n itemId={1}\n >\n Item 2\n </MenuItem>\n <MenuItem\n isSelected={selectedItems.indexOf(2) !== -1}\n actions={<MenuItemAction icon={<RhUiClipboardFillIcon />} actionId=\"copy\" aria-label=\"Copy\" />}\n itemId={2}\n >\n Item 3\n </MenuItem>\n <MenuItem\n isSelected={selectedItems.indexOf(3) !== -1}\n actions={<MenuItemAction icon={<RhUiMenuBarsIcon />} actionId=\"expand\" aria-label=\"Expand\" />}\n description=\"This is a description\"\n itemId={3}\n >\n Item 4\n </MenuItem>\n </MenuList>\n </MenuGroup>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With actions","lang":"ts","className":""}}>
994
+
995
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
996
+ {`To connect a menu item to an action icon, add a `}
997
+
998
+ <code {...{"className":"ws-code "}}>
999
+ {`<MenuItemAction>`}
1000
+ </code>
1001
+ {` to a `}
1002
+
1003
+ <code {...{"className":"ws-code "}}>
1004
+ {`<MenuItem>`}
1005
+ </code>
1006
+ {`, and use the `}
1007
+
1008
+ <code {...{"className":"ws-code "}}>
1009
+ {`icon`}
1010
+ </code>
1011
+ {` property to load an easily recognizable icon.`}
1012
+ </p>
1013
+
1014
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1015
+ {`To trigger an action when any menu action icon is selected, pass a callback to the `}
1016
+
1017
+ <code {...{"className":"ws-code "}}>
1018
+ {`onActionClick`}
1019
+ </code>
1020
+ {` property of the `}
1021
+
1022
+ <code {...{"className":"ws-code "}}>
1023
+ {`<Menu>`}
1024
+ </code>
1025
+ {`. The following example logs to the console any time any action icon is selected.`}
1026
+ </p>
1027
+
1028
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1029
+ {`To trigger an action when a specific item's action icon is selected, pass in the `}
1030
+
1031
+ <code {...{"className":"ws-code "}}>
1032
+ {`onClick`}
1033
+ </code>
1034
+ {` property to that `}
1035
+
1036
+ <code {...{"className":"ws-code "}}>
1037
+ {`<MenuItemAction>`}
1038
+ </code>
1039
+ {`. The following example logs "clicked on code icon" to the console when the "code" icon is selected.`}
1040
+ </p>
1041
+ </Example>,
1042
+ 'With links': props =>
1043
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\n\nexport const MenuWithLinks: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number; // eslint-disable-next-line no-console\n console.log(`clicked ${item}`);\n setActiveItem(item);\n };\n\n return (\n <Menu onSelect={onSelect} activeItemId={activeItem}>\n <MenuContent>\n <MenuList>\n <MenuItem isExternalLink to=\"#default-link1\" itemId={0}>\n Link 1\n </MenuItem>\n <MenuItem isExternalLink to=\"#default-link2\" itemId={1}>\n Link 2\n </MenuItem>\n <MenuItem to=\"#default-link3\" itemId={2}>\n Link 3\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With links","lang":"ts","className":""}}>
1044
+
1045
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1046
+ {`Use the `}
1047
+
1048
+ <code {...{"className":"ws-code "}}>
1049
+ {`to`}
1050
+ </code>
1051
+ {` property to add a link to a `}
1052
+
1053
+ <code {...{"className":"ws-code "}}>
1054
+ {`<MenuItem>`}
1055
+ </code>
1056
+ {` that directs users to a new page when the item is selected. Use the `}
1057
+
1058
+ <code {...{"className":"ws-code "}}>
1059
+ {`isExternalLink`}
1060
+ </code>
1061
+ {` property when linking to external resources. This will annotate a menu item link with an external link icon when they navigate to the link or hover over it, as well as add `}
1062
+
1063
+ <code {...{"className":"ws-code "}}>
1064
+ {`target="_blank"`}
1065
+ </code>
1066
+ {` so that the link opens in a new tab or window.`}
1067
+ </p>
1068
+ </Example>,
1069
+ 'With descriptions': props =>
1070
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\n\nexport const MenuWithDescription: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number; // eslint-disable-next-line no-console\n console.log(`clicked ${item}`);\n setActiveItem(item);\n };\n\n return (\n <Menu onSelect={onSelect} activeItemId={activeItem}>\n <MenuContent>\n <MenuList>\n <MenuItem icon={<RhUiBranchFillIcon />} description=\"Description\" itemId={0}>\n Action 1\n </MenuItem>\n <MenuItem isDisabled icon={<RhUiBranchFillIcon />} description=\"Description\" itemId={1}>\n Action 2 disabled\n </MenuItem>\n <MenuItem\n icon={<RhUiBranchFillIcon />}\n description=\"Nunc non ornare ex, et pretium dui. Duis nec augue at urna elementum blandit tincidunt eget metus. Aenean sed metus id urna dignissim interdum. Aenean vel nisl vitae arcu vehicula pulvinar eget nec turpis. Cras sit amet est est.\"\n itemId={2}\n >\n Action 3\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With descriptions","lang":"ts","className":""}}>
1071
+
1072
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1073
+ {`Use the `}
1074
+
1075
+ <code {...{"className":"ws-code "}}>
1076
+ {`description`}
1077
+ </code>
1078
+ {` property to add short descriptive text below any menu item that needs additional context.`}
1079
+ </p>
1080
+ </Example>,
1081
+ 'Item checkbox': props =>
1082
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\n\nexport const MenuWithCheckbox: React.FunctionComponent = () => {\n const [selectedItems, setSelectedItems] = useState<number[]>([]);\n\n /* eslint no-unused-vars: [\"error\", {\"args\": \"after-used\"}] */\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number;\n if (selectedItems.includes(item)) {\n setSelectedItems(selectedItems.filter((id) => id !== item));\n } else {\n setSelectedItems([...selectedItems, item]);\n }\n };\n\n return (\n <Menu onSelect={onSelect} selected={selectedItems}>\n <MenuContent>\n <MenuList>\n <MenuItem hasCheckbox itemId={0} isSelected={selectedItems.includes(0)}>\n Checkbox 1\n </MenuItem>\n <MenuItem hasCheckbox itemId={1} isSelected={selectedItems.includes(1)}>\n Checkbox 2\n </MenuItem>\n <MenuItem hasCheckbox itemId={2} isDisabled>\n Checkbox 3\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Item checkbox","lang":"ts","className":""}}>
1083
+
1084
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1085
+ {`Use the `}
1086
+
1087
+ <code {...{"className":"ws-code "}}>
1088
+ {`hasCheck`}
1089
+ </code>
1090
+ {` property to add a checkbox to a `}
1091
+
1092
+ <code {...{"className":"ws-code "}}>
1093
+ {`<MenuItem>`}
1094
+ </code>
1095
+ {`. Use the `}
1096
+
1097
+ <code {...{"className":"ws-code "}}>
1098
+ {`isSelected`}
1099
+ </code>
1100
+ {` property to indicate when a `}
1101
+
1102
+ <code {...{"className":"ws-code "}}>
1103
+ {`<MenuItem>`}
1104
+ </code>
1105
+ {` is selected.`}
1106
+ </p>
1107
+ </Example>,
1108
+ 'Menu footer': props =>
1109
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuList, MenuItem, MenuContent, MenuFooter, Button } from '@patternfly/react-core';\n\nexport const MenuWithFooter: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number;\n // eslint-disable-next-line no-console\n console.log(`clicked ${item}`);\n setActiveItem(item);\n };\n\n return (\n <Menu activeItemId={activeItem} onSelect={onSelect}>\n <MenuContent>\n <MenuList>\n <MenuItem itemId={0}>Action</MenuItem>\n <MenuItem\n itemId={1}\n to=\"#default-link2\"\n // just for demo so that navigation is not triggered\n onClick={(event) => event.preventDefault()}\n >\n Link\n </MenuItem>\n <MenuItem isDisabled>Disabled action</MenuItem>\n <MenuItem isDisabled to=\"#default-link4\">\n Disabled link\n </MenuItem>\n </MenuList>\n </MenuContent>\n <MenuFooter>\n <Button variant=\"link\" isInline>\n Action\n </Button>\n </MenuFooter>\n </Menu>\n );\n};\n","title":"Menu footer","lang":"ts","className":""}}>
1110
+
1111
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1112
+ {`Add a `}
1113
+
1114
+ <code {...{"className":"ws-code "}}>
1115
+ {`<MenuFooter>`}
1116
+ </code>
1117
+ {` that contains separate, but related actions at the bottom of a menu.`}
1118
+ </p>
1119
+ </Example>,
1120
+ 'Separated items': props =>
1121
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Divider, Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\n\nexport const MenuWithSeparators: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number;\n // eslint-disable-next-line no-console\n console.log(`clicked ${item}`);\n setActiveItem(item);\n };\n\n return (\n <Menu onSelect={onSelect} activeItemId={activeItem}>\n <MenuContent>\n <MenuList>\n <MenuItem itemId={0}>Action 1</MenuItem>\n <MenuItem itemId={1}>Action 2</MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId={2}>Action 3</MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Separated items","lang":"ts","className":""}}>
1122
+
1123
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1124
+ {`Use a `}
1125
+
1126
+ <PatternflyThemeLink {...{"to":"/components/divider","className":""}}>
1127
+ {`divider`}
1128
+ </PatternflyThemeLink>
1129
+ {` to visually separate `}
1130
+
1131
+ <code {...{"className":"ws-code "}}>
1132
+ {`<MenuContent>`}
1133
+ </code>
1134
+ {`. Use the `}
1135
+
1136
+ <code {...{"className":"ws-code "}}>
1137
+ {`component`}
1138
+ </code>
1139
+ {` property to specify the type of divider component to use.`}
1140
+ </p>
1141
+ </Example>,
1142
+ 'Titled groups of items': props =>
1143
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuGroup, MenuList, MenuItem, Divider } from '@patternfly/react-core';\n\nexport const MenuWithTitledGroups: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number; // eslint-disable-next-line no-console\n console.log(`clicked ${item}`);\n setActiveItem(item);\n };\n\n return (\n <Menu onSelect={onSelect} activeItemId={activeItem}>\n <MenuContent>\n <MenuGroup>\n <MenuList>\n <MenuItem to=\"#\" itemId={0}>\n Link not in group\n </MenuItem>\n </MenuList>\n </MenuGroup>\n <Divider />\n <MenuGroup label=\"Group 1\" labelHeadingLevel=\"h3\">\n <MenuList>\n <MenuItem to=\"#\" itemId={1}>\n Link 1\n </MenuItem>\n <MenuItem itemId={2}>Link 2</MenuItem>\n </MenuList>\n </MenuGroup>\n <Divider />\n <MenuGroup label=\"Group 2\" labelHeadingLevel=\"h3\">\n <MenuList>\n <MenuItem to=\"#\" itemId={3}>\n Link 1\n </MenuItem>\n <MenuItem to=\"#\" itemId={4}>\n Link 2\n </MenuItem>\n </MenuList>\n </MenuGroup>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Titled groups of items","lang":"ts","className":""}}>
1144
+
1145
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1146
+ {`Add a `}
1147
+
1148
+ <code {...{"className":"ws-code "}}>
1149
+ {`<MenuGroup>`}
1150
+ </code>
1151
+ {` to organize `}
1152
+
1153
+ <code {...{"className":"ws-code "}}>
1154
+ {`<MenuContent>`}
1155
+ </code>
1156
+ {` and use the `}
1157
+
1158
+ <code {...{"className":"ws-code "}}>
1159
+ {`label`}
1160
+ </code>
1161
+ {` property to title a group of menu items. Use the `}
1162
+
1163
+ <code {...{"className":"ws-code "}}>
1164
+ {`labelHeadingLevel`}
1165
+ </code>
1166
+ {` property to assign a heading level to the menu group label.`}
1167
+ </p>
1168
+ </Example>,
1169
+ 'With favorites': props =>
1170
+ <Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport { Menu, MenuContent, MenuItem, MenuItemAction, MenuGroup, MenuList, Divider } from '@patternfly/react-core';\nimport RhUiMenuBarsIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-menu-bars-icon';\nimport RhUiClipboardFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-clipboard-fill-icon';\nimport RhUiNotificationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-notification-fill-icon';\n\nexport const MenuWithFavorites: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n const [favorites, setFavorites] = useState<string[]>([]);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number; // eslint-disable-next-line no-console\n console.log(`clicked ${item}`);\n setActiveItem(item);\n };\n\n const onFavorite = (event, itemId: string, actionId: string) => {\n // eslint-disable-next-line no-console\n console.log(`clicked ${itemId} - ${actionId}`);\n if (actionId === 'fav') {\n const isFavorite = favorites.includes(itemId);\n if (isFavorite) {\n setFavorites(favorites.filter((fav) => fav !== itemId));\n } else {\n setFavorites([...favorites, itemId]);\n }\n }\n };\n\n const items = [\n {\n text: 'Item 1',\n description: 'Description 1',\n itemId: 'item-1',\n action: <RhUiMenuBarsIcon />,\n actionId: 'bars'\n },\n {\n text: 'Item 2',\n description: 'Description 2',\n itemId: 'item-2',\n action: <RhUiClipboardFillIcon />,\n actionId: 'clipboard'\n },\n {\n text: 'Item 3',\n description: 'Description 3',\n itemId: 'item-3',\n action: <RhUiNotificationFillIcon />,\n actionId: 'bell'\n }\n ];\n\n return (\n <Menu onSelect={onSelect} onActionClick={onFavorite} activeItemId={activeItem}>\n <MenuContent>\n {favorites.length > 0 && (\n <Fragment>\n <MenuGroup label=\"Favorites\" labelHeadingLevel=\"h3\">\n <MenuList>\n {items\n .filter((item) => favorites.includes(item.itemId))\n .map((item) => {\n const { text, description, itemId, action, actionId } = item;\n return (\n <MenuItem\n key={`fav-${itemId}`}\n isFavorited\n description={description}\n itemId={itemId}\n actions={<MenuItemAction actionId={actionId} icon={action} aria-label={actionId} />}\n >\n {text}\n </MenuItem>\n );\n })}\n </MenuList>\n </MenuGroup>\n <Divider />\n </Fragment>\n )}\n <MenuGroup label=\"All actions\" labelHeadingLevel=\"h3\">\n <MenuList>\n {items.map((item) => {\n const { text, description, itemId, action, actionId } = item;\n const isFavorited = favorites.includes(item.itemId);\n return (\n <MenuItem\n key={itemId}\n isFavorited={isFavorited}\n description={description}\n itemId={itemId}\n actions={<MenuItemAction actionId={actionId} icon={action} aria-label={actionId} />}\n >\n {text}\n </MenuItem>\n );\n })}\n </MenuList>\n </MenuGroup>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With favorites","lang":"ts","className":""}}>
1171
+
1172
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1173
+ {`The following menu example allows users to favorite menu items, an action that duplicates a menu item and places it in a separate group at the top of the menu. The `}
1174
+
1175
+ <code {...{"className":"ws-code "}}>
1176
+ {`isFavorited`}
1177
+ </code>
1178
+ {` property identifies items that a user has favorited.`}
1179
+ </p>
1180
+ </Example>,
1181
+ 'Filtering with search input': props =>
1182
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n Menu,\n MenuList,\n MenuItem,\n MenuContent,\n MenuSearch,\n MenuSearchInput,\n Divider,\n SearchInput\n} from '@patternfly/react-core';\n\nexport const MenuFilteringWithSearchInput: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n const [input, setInput] = useState('');\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number; // eslint-disable-next-line no-console\n console.log(`clicked ${itemId}`);\n setActiveItem(item);\n };\n\n const handleTextInputChange = (value: string) => {\n setInput(value);\n };\n\n const menuListItemsText = ['Action 1', 'Action 2', 'Action 3'];\n\n const menuListItems = menuListItemsText\n .filter((item) => !input || item.toLowerCase().includes(input.toString().toLowerCase()))\n .map((currentValue, index) => (\n <MenuItem key={currentValue} itemId={index}>\n {currentValue}\n </MenuItem>\n ));\n if (input && menuListItems.length === 0) {\n menuListItems.push(\n <MenuItem isDisabled key=\"no result\">\n No results found\n </MenuItem>\n );\n }\n\n return (\n <Menu onSelect={onSelect} activeItemId={activeItem}>\n <MenuSearch>\n <MenuSearchInput>\n <SearchInput\n value={input}\n aria-label=\"Filter menu items\"\n onChange={(_event, value) => handleTextInputChange(value)}\n onClear={() => handleTextInputChange('')}\n />\n </MenuSearchInput>\n </MenuSearch>\n <Divider />\n <MenuContent>\n <MenuList>{menuListItems}</MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Filtering with search input","lang":"ts","className":""}}>
1183
+
1184
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1185
+ {`A `}
1186
+
1187
+ <PatternflyThemeLink {...{"to":"/components/search-input","className":""}}>
1188
+ {`search input`}
1189
+ </PatternflyThemeLink>
1190
+ {` component can be placed within `}
1191
+
1192
+ <code {...{"className":"ws-code "}}>
1193
+ {`<MenuSearch>`}
1194
+ </code>
1195
+ {` and `}
1196
+
1197
+ <code {...{"className":"ws-code "}}>
1198
+ {`<MenuSearchInput>`}
1199
+ </code>
1200
+ {` to render a search input at the top of the menu. In the following example, the `}
1201
+
1202
+ <code {...{"className":"ws-code "}}>
1203
+ {`onChange`}
1204
+ </code>
1205
+ {` property of the text input is passed a callback that filters menu items as a user types.`}
1206
+ </p>
1207
+ </Example>,
1208
+ 'Option single select menu': props =>
1209
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\nimport RhUiTableIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-table-icon';\n\nexport const MenuOptionSingleSelect: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n const [selectedItem, setSelectedItem] = useState(0);\n\n const onSelect = (_event, itemId) => {\n setActiveItem(itemId);\n setSelectedItem(itemId);\n };\n\n return (\n <Menu role=\"listbox\" onSelect={onSelect} activeItemId={activeItem} selected={selectedItem}>\n <MenuContent>\n <MenuList aria-label=\"Menu single select example\">\n <MenuItem itemId={0}>Option 1</MenuItem>\n <MenuItem itemId={1}>Option 2</MenuItem>\n <MenuItem icon={<RhUiTableIcon />} itemId={2}>\n Option 3\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Option single select menu","lang":"ts","className":""}}>
1210
+
1211
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1212
+ {`The following example demonstrates a single option select menu that persists a selected menu item. Use the `}
1213
+
1214
+ <code {...{"className":"ws-code "}}>
1215
+ {`selected`}
1216
+ </code>
1217
+ {` property on the `}
1218
+
1219
+ <code {...{"className":"ws-code "}}>
1220
+ {`<Menu>`}
1221
+ </code>
1222
+ {` to label a selected item with a checkmark. You can also use the `}
1223
+
1224
+ <code {...{"className":"ws-code "}}>
1225
+ {`isSelected`}
1226
+ </code>
1227
+ {` property on a `}
1228
+
1229
+ <code {...{"className":"ws-code "}}>
1230
+ {`<MenuItem>`}
1231
+ </code>
1232
+ {` to indicate that it is selected.`}
1233
+ </p>
1234
+
1235
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1236
+ {`You must also use the `}
1237
+
1238
+ <code {...{"className":"ws-code "}}>
1239
+ {`role`}
1240
+ </code>
1241
+ {` property on the `}
1242
+
1243
+ <code {...{"className":"ws-code "}}>
1244
+ {`<Menu>`}
1245
+ </code>
1246
+ {` with a value of `}
1247
+
1248
+ <code {...{"className":"ws-code "}}>
1249
+ {`"listbox"`}
1250
+ </code>
1251
+ {` when using a non-checkbox select menu.`}
1252
+ </p>
1253
+ </Example>,
1254
+ 'Option multi select menu': props =>
1255
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\nimport RhUiTableIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-table-icon';\n\nexport const MenuOptionMultiSelect: React.FunctionComponent = () => {\n const [selectedItems, setSelectedItems] = useState<number[]>([]);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n const item = itemId as number;\n if (selectedItems.indexOf(item) !== -1) {\n setSelectedItems(selectedItems.filter((id) => id !== item));\n } else {\n setSelectedItems([...selectedItems, item]);\n }\n };\n\n return (\n <Menu role=\"listbox\" onSelect={onSelect} activeItemId={0} selected={selectedItems}>\n <MenuContent>\n <MenuList isAriaMultiselectable aria-label=\"Menu multi select example\">\n <MenuItem itemId={0}>Option 1</MenuItem>\n <MenuItem itemId={1}>Option 2</MenuItem>\n <MenuItem icon={<RhUiTableIcon />} itemId={2}>\n Option 3\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Option multi select menu","lang":"ts","className":""}}>
1256
+
1257
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1258
+ {`To persist multiple selections that a user makes, use a multiple option select menu. To enable multi select, pass an array containing each selected `}
1259
+
1260
+ <code {...{"className":"ws-code "}}>
1261
+ {`itemId`}
1262
+ </code>
1263
+ {` to the `}
1264
+
1265
+ <code {...{"className":"ws-code "}}>
1266
+ {`selected`}
1267
+ </code>
1268
+ {` property on the `}
1269
+
1270
+ <code {...{"className":"ws-code "}}>
1271
+ {`<Menu>`}
1272
+ </code>
1273
+ {`, and pass the `}
1274
+
1275
+ <code {...{"className":"ws-code "}}>
1276
+ {`isAriaMultiselectable`}
1277
+ </code>
1278
+ {` property on the `}
1279
+
1280
+ <code {...{"className":"ws-code "}}>
1281
+ {`<MenuList>`}
1282
+ </code>
1283
+ {`.`}
1284
+ </p>
1285
+
1286
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1287
+ {`Similar to a single select menu, you must also pass `}
1288
+
1289
+ <code {...{"className":"ws-code "}}>
1290
+ {`role="listbox"`}
1291
+ </code>
1292
+ {` to the `}
1293
+
1294
+ <code {...{"className":"ws-code "}}>
1295
+ {`<Menu>`}
1296
+ </code>
1297
+ {`.`}
1298
+ </p>
1299
+ </Example>,
1300
+ 'Scrollable menus': props =>
1301
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\n\nexport const MenuScrollable: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event, itemId) => {\n // eslint-disable-next-line no-console\n console.log(`clicked ${itemId}`);\n setActiveItem(itemId);\n };\n\n return (\n <Menu activeItemId={activeItem} onSelect={onSelect} isScrollable>\n <MenuContent>\n <MenuList>\n <MenuItem itemId={0}>Action 1</MenuItem>\n <MenuItem itemId={1}>Action 2</MenuItem>\n <MenuItem itemId={2}>Action 3</MenuItem>\n <MenuItem itemId={3}>Action 4</MenuItem>\n <MenuItem itemId={4}>Action 5</MenuItem>\n <MenuItem itemId={5}>Action 6</MenuItem>\n <MenuItem itemId={6}>Action 7</MenuItem>\n <MenuItem itemId={7}>Action 8</MenuItem>\n <MenuItem itemId={8}>Action 9</MenuItem>\n <MenuItem itemId={9}>Action 10</MenuItem>\n <MenuItem itemId={10}>Action 11</MenuItem>\n <MenuItem itemId={11}>Action 12</MenuItem>\n <MenuItem itemId={12}>Action 13</MenuItem>\n <MenuItem itemId={13}>Action 14</MenuItem>\n <MenuItem itemId={14}>Action 15</MenuItem>\n <MenuItem\n itemId={15}\n to=\"#default-link2\"\n // just for demo so that navigation is not triggered\n onClick={(event) => event.preventDefault()}\n >\n Link\n </MenuItem>\n <MenuItem isDisabled>Disabled action</MenuItem>\n <MenuItem isDisabled to=\"#default-link4\">\n Disabled link\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Scrollable menus","lang":"ts","className":""}}>
1302
+
1303
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1304
+ {`Use the `}
1305
+
1306
+ <code {...{"className":"ws-code "}}>
1307
+ {`isScrollable`}
1308
+ </code>
1309
+ {` property to make a long `}
1310
+
1311
+ <code {...{"className":"ws-code "}}>
1312
+ {`<Menu>`}
1313
+ </code>
1314
+ {` scrollable and visually condensed.`}
1315
+ </p>
1316
+ </Example>,
1317
+ 'Scrollable menu with custom height': props =>
1318
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';\n\nexport const MenuScrollableCustomMenuHeight: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState(0);\n\n const onSelect = (_event, itemId) => {\n // eslint-disable-next-line no-console\n console.log(`clicked ${itemId}`);\n setActiveItem(itemId);\n };\n\n return (\n <Menu activeItemId={activeItem} onSelect={onSelect} isScrollable>\n <MenuContent menuHeight=\"200px\">\n <MenuList>\n <MenuItem itemId={0}>Action 1</MenuItem>\n <MenuItem itemId={1}>Action 2</MenuItem>\n <MenuItem itemId={2}>Action 3</MenuItem>\n <MenuItem itemId={3}>Action 4</MenuItem>\n <MenuItem itemId={4}>Action 5</MenuItem>\n <MenuItem itemId={5}>Action 6</MenuItem>\n <MenuItem itemId={6}>Action 7</MenuItem>\n <MenuItem itemId={7}>Action 8</MenuItem>\n <MenuItem itemId={8}>Action 9</MenuItem>\n <MenuItem itemId={9}>Action 10</MenuItem>\n <MenuItem itemId={10}>Action 11</MenuItem>\n <MenuItem itemId={11}>Action 12</MenuItem>\n <MenuItem itemId={12}>Action 13</MenuItem>\n <MenuItem itemId={13}>Action 14</MenuItem>\n <MenuItem itemId={14}>Action 15</MenuItem>\n <MenuItem\n itemId={15}\n to=\"#default-link2\"\n // just for demo so that navigation is not triggered\n onClick={(event) => event.preventDefault()}\n >\n Link\n </MenuItem>\n <MenuItem isDisabled>Disabled action</MenuItem>\n <MenuItem isDisabled to=\"#default-link4\">\n Disabled link\n </MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Scrollable menu with custom height","lang":"ts","className":""}}>
1319
+
1320
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1321
+ {`Adjust the visual size of a scrollable menu by using the `}
1322
+
1323
+ <code {...{"className":"ws-code "}}>
1324
+ {`menuHeight`}
1325
+ </code>
1326
+ {` property within `}
1327
+
1328
+ <code {...{"className":"ws-code "}}>
1329
+ {`<MenuContent>`}
1330
+ </code>
1331
+ {`. This example adjusts the height to 200px.`}
1332
+ </p>
1333
+ </Example>,
1334
+ 'With view more': props =>
1335
+ <Example {...pageData} {...props} {...{"code":"import { useEffect, useRef, useState } from 'react';\nimport { Menu, MenuList, MenuItem, MenuContent, Spinner } from '@patternfly/react-core';\n\nexport const MenuWithViewMore: React.FunctionComponent = () => {\n const [activeItem, setActiveItem] = useState<number | string>(0);\n const [isLoading, setIsLoading] = useState(false);\n const [numOptions, setNumOptions] = useState(3);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [menuOptions, setMenuOptions] = useState([\n <MenuItem key={0} itemId={'view-more-0'}>\n Action\n </MenuItem>,\n <MenuItem\n key={1}\n itemId={'view-more-1'}\n to=\"#default-link2\"\n // just for demo so that navigation is not triggered\n onClick={(event) => event.preventDefault()}\n >\n Link\n </MenuItem>,\n <MenuItem key={2} itemId=\"view-more-2\" isDisabled>\n Disabled action\n </MenuItem>,\n <MenuItem key={3} itemId=\"view-more-3\" isDisabled to=\"#default-link4\">\n Disabled link\n </MenuItem>,\n <MenuItem key={4} itemId=\"view-more-4\">\n Action 2\n </MenuItem>,\n <MenuItem key={5} itemId=\"view-more-5\">\n Action 3\n </MenuItem>,\n <MenuItem key={6} itemId=\"view-more-6\">\n Action 4\n </MenuItem>,\n <MenuItem key={7} itemId=\"view-more-7\">\n Action 5\n </MenuItem>,\n <MenuItem key={8} itemId=\"view-more-8\">\n Final option\n </MenuItem>\n ]);\n const [visibleOptions, setVisibleOptions] = useState(menuOptions.slice(0, numOptions));\n\n const activeItemRef = useRef<HTMLElement>(null);\n const viewMoreRef = useRef<HTMLElement>(null);\n\n useEffect(() => {\n activeItemRef.current?.focus();\n }, [visibleOptions]);\n\n const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {\n // eslint-disable-next-line no-console\n console.log(`clicked ${itemId}`);\n setActiveItem(itemId as string);\n };\n\n const simulateNetworkCall = (networkCallback: () => void) => {\n setTimeout(networkCallback, 2000);\n };\n\n const getNextValidItem = (startingIndex: number, maxLength: number) => {\n let validItem;\n for (let i = startingIndex; i < maxLength; i++) {\n if (menuOptions[i].props.isDisabled) {\n continue;\n } else {\n validItem = menuOptions[i];\n break;\n }\n }\n return validItem;\n };\n\n const loadMoreOptions = () => {\n const newLength = numOptions + 3 <= menuOptions.length ? numOptions + 3 : menuOptions.length;\n const prevPosition = numOptions;\n const nextValidItem = getNextValidItem(prevPosition, newLength);\n\n setNumOptions(newLength);\n setIsLoading(false);\n setActiveItem(nextValidItem.props.itemId);\n setVisibleOptions(menuOptions.slice(0, newLength));\n };\n\n const onViewMoreClick = () => {\n setIsLoading(true);\n simulateNetworkCall(() => {\n loadMoreOptions();\n });\n };\n\n return (\n <Menu activeItemId={activeItem} onSelect={onSelect}>\n <MenuContent>\n <MenuList>\n {visibleOptions.map((option) => {\n const props = option.props;\n\n return <MenuItem key={option.key} ref={props.itemId === activeItem ? activeItemRef : null} {...props} />;\n })}\n {numOptions !== menuOptions.length && (\n <MenuItem\n {...(!isLoading && { isLoadButton: true })}\n {...(isLoading && { isLoading: true })}\n onClick={onViewMoreClick}\n itemId=\"loader\"\n ref={viewMoreRef}\n >\n {isLoading ? <Spinner size=\"lg\" /> : 'View more'}\n </MenuItem>\n )}\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With view more","lang":"ts","className":""}}>
1336
+
1337
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1338
+ {`If you want to initially render only a certain number of menu items within a large menu, you can add a "view more" menu item with a callback passed into its `}
1339
+
1340
+ <code {...{"className":"ws-code "}}>
1341
+ {`onClick`}
1342
+ </code>
1343
+ {` property that will render additional menu items.`}
1344
+ </p>
1345
+
1346
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1347
+ {`In this example, 3 additional menu items are revealed each time the "view more" option is selected, with a loading icon simulating a network call to fetch more items. After all items are visible, the "view more" link disappears.`}
1348
+ </p>
1349
+ </Example>,
1350
+ 'With drilldown': props =>
1351
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem, Divider, DrilldownMenu } from '@patternfly/react-core';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\nimport RhUiStorageDomainFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-storage-domain-fill-icon';\nimport RhUiServerStackFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-server-stack-fill-icon';\nimport CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';\n\nexport const MenuWithDrilldown: React.FunctionComponent = () => {\n const [menuDrilledIn, setMenuDrilledIn] = useState<string[]>([]);\n const [drilldownPath, setDrilldownPath] = useState<string[]>([]);\n const [menuHeights, setMenuHeights] = useState<any>({});\n const [activeMenu, setActiveMenu] = useState<string>('drilldown-rootMenu');\n\n const drillIn = (\n _event: React.KeyboardEvent | React.MouseEvent,\n fromMenuId: string,\n toMenuId: string,\n pathId: string\n ) => {\n setMenuDrilledIn([...menuDrilledIn, fromMenuId]);\n setDrilldownPath([...drilldownPath, pathId]);\n setActiveMenu(toMenuId);\n };\n\n const drillOut = (_event: React.KeyboardEvent | React.MouseEvent, toMenuId: string) => {\n const menuDrilledInSansLast = menuDrilledIn.slice(0, menuDrilledIn.length - 1);\n const pathSansLast = drilldownPath.slice(0, drilldownPath.length - 1);\n setMenuDrilledIn(menuDrilledInSansLast);\n setDrilldownPath(pathSansLast);\n setActiveMenu(toMenuId);\n };\n\n const setHeight = (menuId: string, height: number) => {\n if (menuHeights[menuId] === undefined || (menuId !== 'drilldown-rootMenu' && menuHeights[menuId] !== height)) {\n setMenuHeights({ ...menuHeights, [menuId]: height });\n }\n };\n\n return (\n <Menu\n id=\"drilldown-rootMenu\"\n containsDrilldown\n drilldownItemPath={drilldownPath}\n drilledInMenus={menuDrilledIn}\n activeMenu={activeMenu}\n onDrillIn={drillIn}\n onDrillOut={drillOut}\n onGetMenuHeight={setHeight}\n >\n <MenuContent menuHeight={`${menuHeights[activeMenu]}px`}>\n <MenuList>\n <MenuItem\n itemId=\"group:start_rollout\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"drilldown-drilldownMenuStart\">\n <MenuItem itemId=\"group:start_rollout_breadcrumb\" direction=\"up\">\n Start rollout\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem\n itemId=\"group:app_grouping\"\n description=\"Groups A-C\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"drilldown-drilldownMenuStartGrouping\">\n <MenuItem itemId=\"group:app_grouping_breadcrumb\" direction=\"up\">\n Application grouping\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"group_a\">Group A</MenuItem>\n <MenuItem itemId=\"group_b\">Group B</MenuItem>\n <MenuItem itemId=\"group_c\">Group C</MenuItem>\n </DrilldownMenu>\n }\n >\n Application grouping\n </MenuItem>\n <MenuItem itemId=\"count\">Count</MenuItem>\n <MenuItem\n itemId=\"group:labels\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"drilldown-drilldownMenuStartLabels\">\n <MenuItem itemId=\"group:labels_breadcrumb\" direction=\"up\">\n Labels\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"label_1\">Label 1</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3</MenuItem>\n </DrilldownMenu>\n }\n >\n Labels\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations</MenuItem>\n </DrilldownMenu>\n }\n >\n Start rollout\n </MenuItem>\n <MenuItem\n itemId=\"group:pause_rollout\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"drilldown-drilldownMenuPause\">\n <MenuItem itemId=\"group:pause_rollout_breadcrumb\" direction=\"up\">\n Pause rollouts\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem\n itemId=\"group:app_grouping\"\n description=\"Groups A-C\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"drilldown-drilldownMenuGrouping\">\n <MenuItem itemId=\"group:app_grouping_breadcrumb\" direction=\"up\">\n Application grouping\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"group_a\">Group A</MenuItem>\n <MenuItem itemId=\"group_b\">Group B</MenuItem>\n <MenuItem itemId=\"group_c\">Group C</MenuItem>\n </DrilldownMenu>\n }\n >\n Application grouping\n </MenuItem>\n <MenuItem itemId=\"count\">Count</MenuItem>\n <MenuItem\n itemId=\"group:labels\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"drilldown-drilldownMenuLabels\">\n <MenuItem itemId=\"group:labels_breadcrumb\" direction=\"up\">\n Labels\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"label_1\">Label 1</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3</MenuItem>\n </DrilldownMenu>\n }\n >\n Labels\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations</MenuItem>\n </DrilldownMenu>\n }\n >\n Pause rollouts\n </MenuItem>\n <MenuItem\n itemId=\"group:storage\"\n icon={<RhUiStorageDomainFillIcon />}\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"drilldown-drilldownMenuStorage\">\n <MenuItem itemId=\"group:storage_breadcrumb\" icon={<RhUiStorageDomainFillIcon />} direction=\"up\">\n Add storage\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem icon={<RhUiBranchFillIcon />} itemId=\"git\">\n From git\n </MenuItem>\n <MenuItem icon={<RhUiServerStackFillIcon />} itemId=\"container\">\n Container image\n </MenuItem>\n <MenuItem icon={<CubeIcon />} itemId=\"docker\">\n Docker file\n </MenuItem>\n </DrilldownMenu>\n }\n >\n Add storage\n </MenuItem>\n <MenuItem itemId=\"edit\">Edit</MenuItem>\n <MenuItem itemId=\"delete_deployment\">Delete deployment config</MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With drilldown","lang":"ts","className":""}}>
1352
+
1353
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1354
+ {`Use a drilldown menu to contain different levels of menu items. When a parent menu item (an item that has a submenu of children) is selected, the menu is replaced with the children items.`}
1355
+ </p>
1356
+
1357
+ <ul {...{"className":"pf-v6-c-content--ul pf-m-editorial ws-ul "}}>
1358
+
1359
+
1360
+
1361
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1362
+ {`To indicate that a menu contains a drilldown, use the `}
1363
+
1364
+ <code {...{"className":"ws-code "}}>
1365
+ {`containsDrilldown`}
1366
+ </code>
1367
+ {` property.`}
1368
+ </li>
1369
+
1370
+
1371
+
1372
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1373
+ {`To indicate the path of drilled-in menu item ids, use the `}
1374
+
1375
+ <code {...{"className":"ws-code "}}>
1376
+ {`drilldownItemPath`}
1377
+ </code>
1378
+ {` property.`}
1379
+ </li>
1380
+
1381
+
1382
+
1383
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1384
+ {`Pass in an array of drilled-in menus with the `}
1385
+
1386
+ <code {...{"className":"ws-code "}}>
1387
+ {`drilledInMenus`}
1388
+ </code>
1389
+ {` property.`}
1390
+ </li>
1391
+
1392
+
1393
+
1394
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1395
+ {`Use the `}
1396
+
1397
+ <code {...{"className":"ws-code "}}>
1398
+ {`onDrillIn`}
1399
+ </code>
1400
+ {` and `}
1401
+
1402
+ <code {...{"className":"ws-code "}}>
1403
+ {`onDrillOut`}
1404
+ </code>
1405
+ {` properties to contain callbacks for drilling into and drilling out of a submenu, respectively.`}
1406
+ </li>
1407
+
1408
+
1409
+
1410
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1411
+ {`To account for updated heights as menus drill in and out of use, use the `}
1412
+
1413
+ <code {...{"className":"ws-code "}}>
1414
+ {`onGetMenuHeight`}
1415
+ </code>
1416
+ {` property. When starting from a drilled-in state, the `}
1417
+
1418
+ <code {...{"className":"ws-code "}}>
1419
+ {`onGetMenuHeight`}
1420
+ </code>
1421
+ {` property must define the height of the root menu.`}
1422
+ </li>
1423
+
1424
+
1425
+ </ul>
1426
+ </Example>,
1427
+ 'Initially drilled-in menu': props =>
1428
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem, Divider, DrilldownMenu } from '@patternfly/react-core';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\nimport RhUiStorageDomainFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-storage-domain-fill-icon';\nimport RhUiServerStackFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-server-stack-fill-icon';\nimport CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';\n\nexport const MenuDrilldownInitialState: React.FunctionComponent = () => {\n const [menuDrilledIn, setMenuDrilledIn] = useState<string[]>([\n 'initial-state-rootMenu',\n 'initial-state-drilldownMenuStart'\n ]);\n const [drilldownPath, setDrilldownPath] = useState<string[]>(['group:start_rollout', 'group:app_grouping']);\n const [menuHeights, setMenuHeights] = useState<any>({ 'initial-state-rootMenu': 186 }); // The root menu height must be defined when starting from a drilled in state\n const [activeMenu, setActiveMenu] = useState<string>('initial-state-drilldownMenuStartGrouping');\n\n const drillIn = (\n _event: React.KeyboardEvent | React.MouseEvent,\n fromMenuId: string,\n toMenuId: string,\n pathId: string\n ) => {\n setMenuDrilledIn([...menuDrilledIn, fromMenuId]);\n setDrilldownPath([...drilldownPath, pathId]);\n setActiveMenu(toMenuId);\n };\n\n const drillOut = (_event: React.KeyboardEvent | React.MouseEvent, toMenuId: string) => {\n const menuDrilledInSansLast = menuDrilledIn.slice(0, menuDrilledIn.length - 1);\n const pathSansLast = drilldownPath.slice(0, drilldownPath.length - 1);\n setMenuDrilledIn(menuDrilledInSansLast);\n setDrilldownPath(pathSansLast);\n setActiveMenu(toMenuId);\n };\n\n const setHeight = (menuId: string, height: number) => {\n if (menuHeights[menuId] === undefined || (menuId !== 'initial-state-rootMenu' && menuHeights[menuId] !== height)) {\n setMenuHeights({ ...menuHeights, [menuId]: height });\n }\n };\n\n return (\n <Menu\n id=\"initial-state-rootMenu\"\n containsDrilldown\n drilldownItemPath={drilldownPath}\n drilledInMenus={menuDrilledIn}\n activeMenu={activeMenu}\n onDrillIn={drillIn}\n onDrillOut={drillOut}\n onGetMenuHeight={setHeight}\n >\n <MenuContent menuHeight={`${menuHeights[activeMenu]}px`}>\n <MenuList>\n <MenuItem\n itemId=\"group:start_rollout\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"initial-state-drilldownMenuStart\">\n <MenuItem itemId=\"group:start_rollout_breadcrumb\" direction=\"up\">\n Start rollout\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem\n itemId=\"group:app_grouping\"\n description=\"Groups A-C\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"initial-state-drilldownMenuStartGrouping\">\n <MenuItem itemId=\"group:app_grouping_breadcrumb\" direction=\"up\">\n Application grouping\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"group_a\">Group A</MenuItem>\n <MenuItem itemId=\"group_b\">Group B</MenuItem>\n <MenuItem itemId=\"group_c\">Group C</MenuItem>\n </DrilldownMenu>\n }\n >\n Application grouping\n </MenuItem>\n <MenuItem itemId=\"count\">Count</MenuItem>\n <MenuItem\n itemId=\"group:labels\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"initial-state-drilldownMenuStartLabels\">\n <MenuItem itemId=\"group:labels_breadcrumb\" direction=\"up\">\n Labels\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"label_1\">Label 1</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3</MenuItem>\n </DrilldownMenu>\n }\n >\n Labels\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations</MenuItem>\n </DrilldownMenu>\n }\n >\n Start rollout\n </MenuItem>\n <MenuItem\n itemId=\"group:pause_rollout\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"initial-state-drilldownMenuPause\">\n <MenuItem itemId=\"group:pause_rollout_breadcrumb\" direction=\"up\">\n Pause rollouts\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem\n itemId=\"group:app_grouping\"\n description=\"Groups A-C\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"initial-state-drilldownMenuGrouping\">\n <MenuItem itemId=\"group:app_grouping_breadcrumb\" direction=\"up\">\n Application grouping\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"group_a\">Group A</MenuItem>\n <MenuItem itemId=\"group_b\">Group B</MenuItem>\n <MenuItem itemId=\"group_c\">Group C</MenuItem>\n </DrilldownMenu>\n }\n >\n Application grouping\n </MenuItem>\n <MenuItem itemId=\"count\">Count</MenuItem>\n <MenuItem\n itemId=\"group:labels\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"initial-state-drilldownMenuLabels\">\n <MenuItem itemId=\"group:labels_breadcrumb\" direction=\"up\">\n Labels\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"label_1\">Label 1</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3</MenuItem>\n </DrilldownMenu>\n }\n >\n Labels\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations</MenuItem>\n </DrilldownMenu>\n }\n >\n Pause rollouts\n </MenuItem>\n <MenuItem\n itemId=\"group:storage\"\n icon={<RhUiStorageDomainFillIcon />}\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"initial-state-drilldownMenuStorage\">\n <MenuItem itemId=\"group:storage_breadcrumb\" icon={<RhUiStorageDomainFillIcon />} direction=\"up\">\n Add storage\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem icon={<RhUiBranchFillIcon />} itemId=\"git\">\n From git\n </MenuItem>\n <MenuItem icon={<RhUiServerStackFillIcon />} itemId=\"container\">\n Container image\n </MenuItem>\n <MenuItem icon={<CubeIcon />} itemId=\"docker\">\n Docker file\n </MenuItem>\n </DrilldownMenu>\n }\n >\n Add storage\n </MenuItem>\n <MenuItem itemId=\"edit\">Edit</MenuItem>\n <MenuItem itemId=\"delete_deployment\">Delete deployment config</MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"Initially drilled-in menu","lang":"ts","className":""}}>
1429
+
1430
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1431
+ {`To render an initially drilled-in menu, the `}
1432
+
1433
+ <code {...{"className":"ws-code "}}>
1434
+ {`drilldownItemPath`}
1435
+ </code>
1436
+ {`, `}
1437
+
1438
+ <code {...{"className":"ws-code "}}>
1439
+ {`drilledInMenus`}
1440
+ </code>
1441
+ {`, and `}
1442
+
1443
+ <code {...{"className":"ws-code "}}>
1444
+ {`activeMenu`}
1445
+ </code>
1446
+ {` properties must be set to default values.`}
1447
+ </p>
1448
+ </Example>,
1449
+ 'With drilldown - submenu functions': props =>
1450
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Menu, MenuContent, MenuList, MenuItem, Divider, DrilldownMenu } from '@patternfly/react-core';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\nimport RhUiStorageDomainFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-storage-domain-fill-icon';\nimport RhUiServerStackFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-server-stack-fill-icon';\nimport CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';\n\nexport const MenuWithDrilldownSubmenuFunctions: React.FunctionComponent = () => {\n const [menuDrilledIn, setMenuDrilledIn] = useState<string[]>([]);\n const [drilldownPath, setDrilldownPath] = useState<string[]>([]);\n const [menuHeights, setMenuHeights] = useState<any>({});\n const [activeMenu, setActiveMenu] = useState<string>('functions-rootMenu');\n\n const drillIn = (\n _event: React.KeyboardEvent | React.MouseEvent,\n fromMenuId: string,\n toMenuId: string,\n pathId: string\n ) => {\n setMenuDrilledIn([...menuDrilledIn, fromMenuId]);\n setDrilldownPath([...drilldownPath, pathId]);\n setActiveMenu(toMenuId);\n };\n\n const drillOut = (_event: React.KeyboardEvent | React.MouseEvent, toMenuId: string) => {\n const menuDrilledInSansLast = menuDrilledIn.slice(0, menuDrilledIn.length - 1);\n const pathSansLast = drilldownPath.slice(0, drilldownPath.length - 1);\n setMenuDrilledIn(menuDrilledInSansLast);\n setDrilldownPath(pathSansLast);\n setActiveMenu(toMenuId);\n };\n\n const setHeight = (menuId: string, height: number) => {\n if (menuHeights[menuId] === undefined || (menuId !== 'functions-rootMenu' && menuHeights[menuId] !== height)) {\n setMenuHeights({ ...menuHeights, [menuId]: height });\n }\n };\n\n return (\n <Menu\n id=\"functions-rootMenu\"\n containsDrilldown\n drilldownItemPath={drilldownPath}\n drilledInMenus={menuDrilledIn}\n activeMenu={activeMenu}\n onDrillIn={drillIn}\n onDrillOut={drillOut}\n onGetMenuHeight={setHeight}\n >\n <MenuContent menuHeight={`${menuHeights[activeMenu]}px`}>\n <MenuList>\n <MenuItem\n itemId=\"group:start_rollout\"\n direction=\"down\"\n drilldownMenu={() => (\n <DrilldownMenu id=\"functions-drilldownMenuStart\">\n <MenuItem itemId=\"group:start_rollout_breadcrumb\" direction=\"up\">\n Start rollout\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem\n itemId=\"group:app_grouping\"\n description=\"Groups A-C\"\n direction=\"down\"\n drilldownMenu={() => (\n <DrilldownMenu id=\"functions-drilldownMenuStartGrouping\">\n <MenuItem itemId=\"group:app_grouping_breadcrumb\" direction=\"up\">\n Application grouping\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"group_a\">Group A</MenuItem>\n <MenuItem itemId=\"group_b\">Group B</MenuItem>\n <MenuItem itemId=\"group_c\">Group C</MenuItem>\n </DrilldownMenu>\n )}\n >\n Application grouping\n </MenuItem>\n <MenuItem itemId=\"count\">Count</MenuItem>\n <MenuItem\n itemId=\"group:labels\"\n direction=\"down\"\n drilldownMenu={() => (\n <DrilldownMenu id=\"functions-drilldownMenuStartLabels\">\n <MenuItem itemId=\"group:labels_breadcrumb\" direction=\"up\">\n Labels\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"label_1\">Label 1</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3</MenuItem>\n </DrilldownMenu>\n )}\n >\n Labels\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations</MenuItem>\n </DrilldownMenu>\n )}\n >\n Start rollout\n </MenuItem>\n <MenuItem\n itemId=\"group:pause_rollout\"\n direction=\"down\"\n drilldownMenu={() => (\n <DrilldownMenu id=\"functions-drilldownMenuPause\">\n <MenuItem itemId=\"group:pause_rollout_breadcrumb\" direction=\"up\">\n Pause rollouts\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem\n itemId=\"group:app_grouping\"\n description=\"Groups A-C\"\n direction=\"down\"\n drilldownMenu={() => (\n <DrilldownMenu id=\"functions-drilldownMenuGrouping\">\n <MenuItem itemId=\"group:app_grouping_breadcrumb\" direction=\"up\">\n Application grouping\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"group_a\">Group A</MenuItem>\n <MenuItem itemId=\"group_b\">Group B</MenuItem>\n <MenuItem itemId=\"group_c\">Group C</MenuItem>\n </DrilldownMenu>\n )}\n >\n Application grouping\n </MenuItem>\n <MenuItem itemId=\"count\">Count</MenuItem>\n <MenuItem\n itemId=\"group:labels\"\n direction=\"down\"\n drilldownMenu={() => (\n <DrilldownMenu id=\"functions-drilldownMenuLabels\">\n <MenuItem itemId=\"group:labels_breadcrumb\" direction=\"up\">\n Labels\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem itemId=\"label_1\">Label 1</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3</MenuItem>\n </DrilldownMenu>\n )}\n >\n Labels\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations</MenuItem>\n </DrilldownMenu>\n )}\n >\n Pause rollouts\n </MenuItem>\n <MenuItem\n itemId=\"group:storage\"\n icon={<RhUiStorageDomainFillIcon />}\n direction=\"down\"\n drilldownMenu={() => (\n <DrilldownMenu id=\"functions-drilldownMenuStorage\">\n <MenuItem itemId=\"group:storage_breadcrumb\" icon={<RhUiStorageDomainFillIcon />} direction=\"up\">\n Add storage\n </MenuItem>\n <Divider component=\"li\" />\n <MenuItem icon={<RhUiBranchFillIcon />} itemId=\"git\">\n From git\n </MenuItem>\n <MenuItem icon={<RhUiServerStackFillIcon />} itemId=\"container\">\n Container image\n </MenuItem>\n <MenuItem icon={<CubeIcon />} itemId=\"docker\">\n Docker file\n </MenuItem>\n </DrilldownMenu>\n )}\n >\n Add storage\n </MenuItem>\n <MenuItem itemId=\"edit\">Edit</MenuItem>\n <MenuItem itemId=\"delete_deployment\">Delete deployment config</MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With drilldown - submenu functions","lang":"ts","className":""}}>
1451
+
1452
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1453
+ {`For added flexibility with large menus, you may create a menu by passing a function to `}
1454
+
1455
+ <code {...{"className":"ws-code "}}>
1456
+ {`drilldownMenu`}
1457
+ </code>
1458
+ {`. This approach allows you to create menu items dynamically, rather than creating everything up front.`}
1459
+ </p>
1460
+ </Example>,
1461
+ 'With drilldown breadcrumbs': props =>
1462
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n Badge,\n Breadcrumb,\n BreadcrumbHeading,\n BreadcrumbItem,\n Checkbox,\n Divider,\n DrilldownMenu,\n Dropdown,\n DropdownItem,\n DropdownList,\n Icon,\n Menu,\n MenuBreadcrumb,\n MenuContent,\n MenuItem,\n MenuList,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\nimport RhUiStorageDomainFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-storage-domain-fill-icon';\nimport RhUiServerStackFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-server-stack-fill-icon';\nimport RhMicronsCaretLeftIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-left-icon';\nimport CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';\n\nexport const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {\n const [menuDrilledIn, setMenuDrilledIn] = useState<string[]>([]);\n const [drilldownPath, setDrilldownPath] = useState<string[]>([]);\n const [menuHeights, setMenuHeights] = useState<any>({});\n const [activeMenu, setActiveMenu] = useState<string>('breadcrumbs-rootMenu');\n const [breadcrumb, setBreadcrumb] = useState<React.JSX.Element | null>();\n const [withMaxMenuHeight, setWithMaxMenuHeight] = useState(false);\n\n const onToggle = (isOpen: boolean, key: string) => {\n switch (key) {\n case 'app':\n setBreadcrumb(appGroupingBreadcrumb(isOpen));\n break;\n case 'label':\n setBreadcrumb(labelsBreadcrumb(isOpen));\n break;\n case 'pause-app':\n setBreadcrumb(pauseRolloutsAppGrpBreadcrumb(isOpen));\n break;\n case 'pause-label':\n setBreadcrumb(pauseRolloutsLabelsBreadcrumb(isOpen));\n break;\n default:\n break;\n }\n };\n\n const onToggleMaxMenuHeight = (checked: boolean) => {\n setWithMaxMenuHeight(checked);\n };\n\n const drillOut = (\n _event: React.KeyboardEvent<Element> | MouseEvent | React.MouseEvent<any, MouseEvent>,\n toMenuId: string,\n fromPathId: string,\n breadcrumb: React.JSX.Element | null\n ) => {\n setMenuDrilledIn((prevMenuDrilledIn) => {\n const indexOfMenuId = prevMenuDrilledIn.indexOf(toMenuId);\n return prevMenuDrilledIn.slice(0, indexOfMenuId);\n });\n setDrilldownPath((prevDrilldownPath) => {\n const indexOfMenuIdPath = prevDrilldownPath.indexOf(fromPathId);\n return prevDrilldownPath.slice(0, indexOfMenuIdPath);\n });\n setActiveMenu(toMenuId);\n setBreadcrumb(breadcrumb);\n };\n\n const setHeight = (menuId: string, height: number) => {\n if (menuHeights[menuId] === undefined || (menuId !== 'breadcrumbs-rootMenu' && menuHeights[menuId] !== height)) {\n setMenuHeights({ ...menuHeights, [menuId]: height });\n }\n };\n\n const drillIn = (\n _event: React.KeyboardEvent | React.MouseEvent,\n fromMenuId: string,\n toMenuId: string,\n pathId: string\n ) => {\n setMenuDrilledIn([...menuDrilledIn, fromMenuId]);\n setDrilldownPath([...drilldownPath, pathId]);\n setActiveMenu(toMenuId);\n };\n\n const startRolloutBreadcrumb = (\n <Breadcrumb>\n <BreadcrumbItem\n component=\"button\"\n onClick={(event: any) => drillOut(event, 'breadcrumbs-rootMenu', 'group:start_rollout', null)}\n >\n Root\n </BreadcrumbItem>\n <BreadcrumbHeading component=\"button\">Start rollout</BreadcrumbHeading>\n </Breadcrumb>\n );\n\n const appGroupingBreadcrumb = (isOpen: boolean) => (\n <Breadcrumb>\n <BreadcrumbItem\n component=\"button\"\n onClick={(event: any) => drillOut(event, 'breadcrumbs-rootMenu', 'group:start_rollout', null)}\n >\n Root\n </BreadcrumbItem>\n <BreadcrumbItem isDropdown>\n <Dropdown\n isOpen={isOpen}\n onOpenChange={(isOpen: boolean) => onToggle(isOpen, 'app')}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n badge={\n <Badge isRead screenReaderText=\"additional item\">\n 1\n </Badge>\n }\n ref={toggleRef}\n onClick={() => onToggle(true, 'app')}\n isExpanded={isOpen}\n variant=\"plainText\"\n />\n )}\n >\n <DropdownList>\n <DropdownItem\n key=\"dropdown-start\"\n icon={\n <Icon shouldMirrorRTL>\n <RhMicronsCaretLeftIcon />\n </Icon>\n }\n onClick={(event: any) =>\n drillOut(event, 'breadcrumbs-drilldownMenuStart', 'group:app_grouping_start', startRolloutBreadcrumb)\n }\n >\n Start rollout\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </BreadcrumbItem>\n <BreadcrumbHeading component=\"button\">Application Grouping</BreadcrumbHeading>\n </Breadcrumb>\n );\n\n const labelsBreadcrumb = (isOpen: boolean) => (\n <Breadcrumb>\n <BreadcrumbItem\n component=\"button\"\n onClick={(event: any) => drillOut(event, 'breadcrumbs-rootMenu', 'group:start_rollout', null)}\n >\n Root\n </BreadcrumbItem>\n <BreadcrumbItem isDropdown>\n <Dropdown\n isOpen={isOpen}\n onOpenChange={(isOpen: boolean) => onToggle(isOpen, 'label')}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n badge={\n <Badge isRead screenReaderText=\"additional item\">\n 1\n </Badge>\n }\n ref={toggleRef}\n onClick={() => onToggle(true, 'label')}\n isExpanded={isOpen}\n variant=\"plainText\"\n />\n )}\n >\n <DropdownList>\n <DropdownItem\n key=\"dropdown-start\"\n icon={\n <Icon shouldMirrorRTL>\n <RhMicronsCaretLeftIcon />\n </Icon>\n }\n onClick={(event: any) =>\n drillOut(event, 'breadcrumbs-drilldownMenuStart', 'group:labels_start', startRolloutBreadcrumb)\n }\n >\n Start rollout\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </BreadcrumbItem>\n <BreadcrumbHeading component=\"button\">Labels</BreadcrumbHeading>\n </Breadcrumb>\n );\n\n const pauseRolloutsBreadcrumb = (\n <Breadcrumb>\n <BreadcrumbItem\n component=\"button\"\n onClick={(event: any) => drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}\n >\n Root\n </BreadcrumbItem>\n <BreadcrumbHeading component=\"button\">Pause rollouts</BreadcrumbHeading>\n </Breadcrumb>\n );\n\n const pauseRolloutsAppGrpBreadcrumb = (isOpen: boolean) => (\n <Breadcrumb>\n <BreadcrumbItem\n component=\"button\"\n onClick={(event: any) => drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}\n >\n Root\n </BreadcrumbItem>\n <BreadcrumbItem isDropdown>\n <Dropdown\n isOpen={isOpen}\n onOpenChange={(isOpen: boolean) => onToggle(isOpen, 'pause-app')}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n badge={\n <Badge isRead screenReaderText=\"additional item\">\n 1\n </Badge>\n }\n ref={toggleRef}\n onClick={() => onToggle(true, 'pause-app')}\n isExpanded={isOpen}\n variant=\"plainText\"\n />\n )}\n >\n <DropdownList>\n <DropdownItem\n key=\"dropdown-pause\"\n icon={\n <Icon shouldMirrorRTL>\n <RhMicronsCaretLeftIcon />\n </Icon>\n }\n onClick={(event: any) =>\n drillOut(event, 'breadcrumbs-drilldownMenuPause', 'group:app_grouping', pauseRolloutsBreadcrumb)\n }\n >\n Pause rollouts\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </BreadcrumbItem>\n <BreadcrumbHeading component=\"button\">Application Grouping</BreadcrumbHeading>\n </Breadcrumb>\n );\n\n const pauseRolloutsLabelsBreadcrumb = (isOpen: boolean) => (\n <Breadcrumb>\n <BreadcrumbItem\n component=\"button\"\n onClick={(event: any) => drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}\n >\n Root\n </BreadcrumbItem>\n <BreadcrumbItem isDropdown>\n <Dropdown\n isOpen={isOpen}\n onOpenChange={(isOpen: boolean) => onToggle(isOpen, 'pause-label')}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n badge={\n <Badge isRead screenReaderText=\"additional item\">\n 1\n </Badge>\n }\n ref={toggleRef}\n onClick={() => onToggle(true, 'pause-label')}\n isExpanded={isOpen}\n variant=\"plainText\"\n />\n )}\n >\n <DropdownList>\n <DropdownItem\n key=\"dropdown-pause\"\n icon={\n <Icon shouldMirrorRTL>\n <RhMicronsCaretLeftIcon />\n </Icon>\n }\n onClick={(event: any) =>\n drillOut(event, 'breadcrumbs-drilldownMenuPause', 'group:labels', pauseRolloutsBreadcrumb)\n }\n >\n Pause rollouts\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </BreadcrumbItem>\n <BreadcrumbHeading component=\"button\">Labels</BreadcrumbHeading>\n </Breadcrumb>\n );\n\n const addStorageBreadcrumb = (\n <Breadcrumb>\n <BreadcrumbItem\n component=\"button\"\n onClick={(event: any) => drillOut(event, 'breadcrumbs-rootMenu', 'group:storage', null)}\n >\n Root\n </BreadcrumbItem>\n <BreadcrumbHeading component=\"button\">Add storage</BreadcrumbHeading>\n </Breadcrumb>\n );\n\n return (\n <>\n <Checkbox\n label=\"Set max menu height\"\n isChecked={withMaxMenuHeight}\n onChange={(_event, checked) => onToggleMaxMenuHeight(checked)}\n aria-label=\"Set max menu height checkbox\"\n id=\"toggle-max-menu-height\"\n name=\"toggle-max-menu-height\"\n />\n <br />\n <Menu\n id=\"breadcrumbs-rootMenu\"\n containsDrilldown\n drilldownItemPath={drilldownPath}\n drilledInMenus={menuDrilledIn}\n activeMenu={activeMenu}\n onDrillIn={drillIn}\n onDrillOut={() => drillOut}\n onGetMenuHeight={setHeight}\n isScrollable={withMaxMenuHeight}\n >\n {breadcrumb && (\n <>\n <MenuBreadcrumb>{breadcrumb}</MenuBreadcrumb>\n <Divider />\n </>\n )}\n <MenuContent menuHeight={`${menuHeights[activeMenu]}px`} maxMenuHeight={withMaxMenuHeight ? '100px' : 'auto'}>\n <MenuList>\n <MenuItem\n itemId=\"group:start_rollout\"\n direction=\"down\"\n onClick={() => setBreadcrumb(startRolloutBreadcrumb)}\n drilldownMenu={\n <DrilldownMenu id=\"breadcrumbs-drilldownMenuStart\">\n <MenuItem\n itemId=\"group:app_grouping_start\"\n description=\"Groups A-G\"\n direction=\"down\"\n onClick={() => setBreadcrumb(appGroupingBreadcrumb(false))}\n drilldownMenu={\n <DrilldownMenu id=\"breadcrumbs-drilldownMenuStartGrouping\">\n <MenuItem itemId=\"group_a\">Group A (start rollout)</MenuItem>\n <MenuItem itemId=\"group_b\">Group B (start rollout)</MenuItem>\n <MenuItem itemId=\"group_c\">Group C (start rollout)</MenuItem>\n <MenuItem itemId=\"group_d\">Group D (start rollout)</MenuItem>\n <MenuItem itemId=\"group_e\">Group E (start rollout)</MenuItem>\n <MenuItem itemId=\"group_f\">Group F (start rollout)</MenuItem>\n <MenuItem itemId=\"group_g\">Group G (start rollout)</MenuItem>\n </DrilldownMenu>\n }\n >\n Application grouping (start rollout)\n </MenuItem>\n <MenuItem itemId=\"count\">Count (start rollout)</MenuItem>\n <MenuItem\n itemId=\"group:labels_start\"\n direction=\"down\"\n onClick={() => setBreadcrumb(labelsBreadcrumb(false))}\n drilldownMenu={\n <DrilldownMenu id=\"breadcrumbs-drilldownMenuStartLabels\">\n <MenuItem itemId=\"label_1\">Label 1 (start rollout)</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2 (start rollout)</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3 (start rollout)</MenuItem>\n </DrilldownMenu>\n }\n >\n Labels (start rollout)\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations (start rollout)</MenuItem>\n </DrilldownMenu>\n }\n >\n Start rollout\n </MenuItem>\n <MenuItem\n itemId=\"group:pause_rollout\"\n direction=\"down\"\n onClick={() => setBreadcrumb(pauseRolloutsBreadcrumb)}\n drilldownMenu={\n <DrilldownMenu id=\"breadcrumbs-drilldownMenuPause\">\n <MenuItem\n itemId=\"group:app_grouping\"\n description=\"Groups A-C\"\n direction=\"down\"\n onClick={() => setBreadcrumb(pauseRolloutsAppGrpBreadcrumb(false))}\n drilldownMenu={\n <DrilldownMenu id=\"breadcrumbs-drilldownMenuGrouping\">\n <MenuItem itemId=\"group_a\">Group A (pause rollouts)</MenuItem>\n <MenuItem itemId=\"group_b\">Group B (pause rollouts)</MenuItem>\n <MenuItem itemId=\"group_c\">Group C (pause rollouts)</MenuItem>\n </DrilldownMenu>\n }\n >\n Application grouping (pause rollouts)\n </MenuItem>\n <MenuItem itemId=\"count\">Count (pause rollouts)</MenuItem>\n <MenuItem\n itemId=\"group:labels\"\n direction=\"down\"\n onClick={() => setBreadcrumb(pauseRolloutsLabelsBreadcrumb(false))}\n drilldownMenu={\n <DrilldownMenu id=\"breadcrumbs-drilldownMenuLabels\">\n <MenuItem itemId=\"label_1\">Label 1 (pause rollouts)</MenuItem>\n <MenuItem itemId=\"label_2\">Label 2 (pause rollouts)</MenuItem>\n <MenuItem itemId=\"label_3\">Label 3 (pause rollouts)</MenuItem>\n </DrilldownMenu>\n }\n >\n Labels (pause rollouts)\n </MenuItem>\n <MenuItem itemId=\"annotations\">Annotations (pause rollouts)</MenuItem>\n </DrilldownMenu>\n }\n >\n Pause rollouts\n </MenuItem>\n <MenuItem\n itemId=\"group:storage\"\n icon={<RhUiStorageDomainFillIcon />}\n direction=\"down\"\n onClick={() => setBreadcrumb(addStorageBreadcrumb)}\n drilldownMenu={\n <DrilldownMenu id=\"breadcrumbs-drilldownMenuStorage\">\n <MenuItem icon={<RhUiBranchFillIcon />} itemId=\"git\">\n From git\n </MenuItem>\n <MenuItem icon={<RhUiServerStackFillIcon />} itemId=\"container\">\n Container image\n </MenuItem>\n <MenuItem icon={<CubeIcon />} itemId=\"docker\">\n Docker file\n </MenuItem>\n </DrilldownMenu>\n }\n >\n Add storage\n </MenuItem>\n <MenuItem itemId=\"edit\">Edit</MenuItem>\n <MenuItem itemId=\"delete_deployment\">Delete deployment config</MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n </>\n );\n};\n","title":"With drilldown breadcrumbs","lang":"ts","className":""}}>
1463
+
1464
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1465
+ {`Use `}
1466
+
1467
+ <PatternflyThemeLink {...{"to":"/components/breadcrumb","className":""}}>
1468
+ {`breadcrumbs`}
1469
+ </PatternflyThemeLink>
1470
+ {` when a drilldown menu has more than 2 levels to offer users better navigation.`}
1471
+ </p>
1472
+
1473
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1474
+ {`To control the height of a menu, use the `}
1475
+
1476
+ <code {...{"className":"ws-code "}}>
1477
+ {`maxMenuHeight`}
1478
+ </code>
1479
+ {` property. Selecting the "Set max menu height" checkbox in the following example sets the menu height to "100px" and makes the menu scrollable.`}
1480
+ </p>
1481
+ </Example>,
1482
+ 'With drilldown and inline filter': props =>
1483
+ <Example {...pageData} {...props} {...{"code":"import { createRef, useState } from 'react';\nimport {\n Menu,\n MenuContent,\n MenuList,\n MenuItem,\n Divider,\n DrilldownMenu,\n MenuSearch,\n MenuSearchInput,\n SearchInput\n} from '@patternfly/react-core';\n\nexport const MenuWithDrilldown: React.FunctionComponent = () => {\n const [menuDrilledIn, setMenuDrilledIn] = useState<string[]>([]);\n const [drilldownPath, setDrilldownPath] = useState<string[]>([]);\n const [menuHeights, setMenuHeights] = useState<any>({});\n const [activeMenu, setActiveMenu] = useState<string>('filter_drilldown-rootMenu');\n\n const drillIn = (\n _event: React.KeyboardEvent | React.MouseEvent,\n fromMenuId: string,\n toMenuId: string,\n pathId: string\n ) => {\n setMenuDrilledIn([...menuDrilledIn, fromMenuId]);\n setDrilldownPath([...drilldownPath, pathId]);\n setActiveMenu(toMenuId);\n };\n\n const drillOut = (_event: React.KeyboardEvent | React.MouseEvent, toMenuId: string) => {\n const menuDrilledInSansLast = menuDrilledIn.slice(0, menuDrilledIn.length - 1);\n const pathSansLast = drilldownPath.slice(0, drilldownPath.length - 1);\n setMenuDrilledIn(menuDrilledInSansLast);\n setDrilldownPath(pathSansLast);\n setActiveMenu(toMenuId);\n };\n\n const setHeight = (menuId: string, height: number) => {\n if (\n menuHeights[menuId] === undefined ||\n (menuId !== 'filter_drilldown-rootMenu' && menuHeights[menuId] !== height)\n ) {\n setMenuHeights({ ...menuHeights, [menuId]: height });\n }\n };\n\n const searchRef = createRef<HTMLInputElement>();\n const [startInput, setStartInput] = useState('');\n\n const handleStartTextInputChange = (value: string) => {\n setStartInput(value);\n searchRef?.current?.focus();\n };\n\n const startDrillItems = [\n {\n item: 'Application grouping',\n rest: { description: 'Description text' }\n },\n { item: 'Labels' },\n { item: 'Annotations' },\n { item: 'Count' },\n { item: 'Count 2' },\n { item: 'Count 3' },\n { item: 'Other' }\n ];\n\n const mapped = startDrillItems\n .filter((opt) => !startInput || opt.item.toLowerCase().includes(startInput.toString().toLowerCase()))\n .map((opt, index) => (\n <MenuItem key={opt.item} itemId={index} {...opt.rest}>\n {opt.item}\n </MenuItem>\n ));\n if (startInput && mapped.length === 0) {\n mapped.push(\n <MenuItem isDisabled key=\"no result\">\n No results found\n </MenuItem>\n );\n }\n\n return (\n <Menu\n id=\"filter_drilldown-rootMenu\"\n containsDrilldown\n drilldownItemPath={drilldownPath}\n drilledInMenus={menuDrilledIn}\n activeMenu={activeMenu}\n onDrillIn={drillIn}\n onDrillOut={drillOut}\n onGetMenuHeight={setHeight}\n >\n <MenuContent menuHeight={`${menuHeights[activeMenu]}px`}>\n <MenuList>\n <MenuItem\n itemId=\"filter_group:start_rollout\"\n direction=\"down\"\n drilldownMenu={\n <DrilldownMenu id=\"filter_drilldown-drilldownMenuStart\">\n <MenuItem itemId=\"filter_group:start_rollout_breadcrumb\" direction=\"up\">\n Start rollout\n </MenuItem>\n <Divider component=\"li\" />\n <MenuSearch>\n <MenuSearchInput>\n <SearchInput\n ref={searchRef}\n value={startInput}\n aria-label=\"Filter menu items\"\n onChange={(_event, value) => handleStartTextInputChange(value)}\n onClear={() => handleStartTextInputChange('')}\n />\n </MenuSearchInput>\n </MenuSearch>\n <Divider component=\"li\" />\n {mapped}\n </DrilldownMenu>\n }\n >\n Start rollout\n </MenuItem>\n <MenuItem itemId=\"item-a\">Item B</MenuItem>\n <MenuItem itemId=\"item-b\">Item C</MenuItem>\n <MenuItem itemId=\"item-c\">Item D</MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n};\n","title":"With drilldown and inline filter","lang":"ts","className":""}}>
1484
+
1485
+ </Example>
1486
+ };
1487
+
1488
+ const Component = () => (
1489
+ <React.Fragment>
1490
+ <AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
1491
+ {`Examples`}
1492
+ </AutoLinkHeader>
1493
+ {React.createElement(pageData.examples["Basic menus"])}
1494
+ {React.createElement(pageData.examples["Danger menu item"])}
1495
+ {React.createElement(pageData.examples["With icons"])}
1496
+ {React.createElement(pageData.examples["With actions"])}
1497
+ {React.createElement(pageData.examples["With links"])}
1498
+ {React.createElement(pageData.examples["With descriptions"])}
1499
+ {React.createElement(pageData.examples["Item checkbox"])}
1500
+ {React.createElement(pageData.examples["Menu footer"])}
1501
+ {React.createElement(pageData.examples["Separated items"])}
1502
+ {React.createElement(pageData.examples["Titled groups of items"])}
1503
+ {React.createElement(pageData.examples["With favorites"])}
1504
+ {React.createElement(pageData.examples["Filtering with search input"])}
1505
+ {React.createElement(pageData.examples["Option single select menu"])}
1506
+ {React.createElement(pageData.examples["Option multi select menu"])}
1507
+ {React.createElement(pageData.examples["Scrollable menus"])}
1508
+ {React.createElement(pageData.examples["Scrollable menu with custom height"])}
1509
+ {React.createElement(pageData.examples["With view more"])}
1510
+ {React.createElement(pageData.examples["With drilldown"])}
1511
+ {React.createElement(pageData.examples["Initially drilled-in menu"])}
1512
+ {React.createElement(pageData.examples["With drilldown - submenu functions"])}
1513
+ {React.createElement(pageData.examples["With drilldown breadcrumbs"])}
1514
+ {React.createElement(pageData.examples["With drilldown and inline filter"])}
1515
+ <AutoLinkHeader {...{"id":"using-router-links","headingLevel":"h2","className":"ws-title ws-h2"}}>
1516
+ {`Using router links`}
1517
+ </AutoLinkHeader>
1518
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1519
+ {`Router links can be used for in-app linking in React environments to prevent page reloading. To use a `}
1520
+ <code {...{"className":"ws-code "}}>
1521
+ {`Link`}
1522
+ </code>
1523
+ {` component from a router package, you can pass a callback to the `}
1524
+ <code {...{"className":"ws-code "}}>
1525
+ {`component`}
1526
+ </code>
1527
+ {` property of the `}
1528
+ <code {...{"className":"ws-code "}}>
1529
+ {`MenuItem`}
1530
+ </code>
1531
+ {`:`}
1532
+ </p>
1533
+ <Example {...{"code":"<MenuItem\n component={(props) => <Link {...props} to=\"#\" />}\n>\n {...Link Content}\n</MenuItem>","lang":"nolive","className":""}}>
1534
+ </Example>
1535
+ </React.Fragment>
1536
+ );
1537
+ Component.displayName = 'ComponentsMenusMenuReactDocs';
1538
+ Component.pageData = pageData;
1539
+
1540
+ export default Component;