You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ``Header`` component is used to display a header with a provided ``mainMenuItems``,
10
+
``secondaryMenuItems``, and ``userMenuItems`` props. If props are provided, the component will use them; otherwise,
11
+
if any of the props ``(mainMenuItems, secondaryMenuItems, userMenuItems)`` are not provided, default
12
+
items will be displayed. This component provides flexibility in customization, making it suitable for a wide
13
+
range of applications.
14
+
15
+
Props Details
16
+
-------------
17
+
18
+
The `Header` component accepts the following **optional** props for customization:
19
+
20
+
``mainMenuItems``
21
+
*****************
22
+
23
+
The main menu items is a list of menu items objects. On desktop screens, these items are displayed on the left side next to the logo icon.
24
+
On mobile screens, the main menu is displayed as a dropdown menu triggered by a hamburger icon. The main menu dropdown appears below the logo when opened.
To implement a submenu, set the type to ``submenu`` and provide a ``submenuContent`` property.
48
+
The submenuContent should be a React component (as shown in above example) that can be rendered.
49
+
50
+
**Note:**
51
+
52
+
- The ``type`` should be ``item`` or ``submenu``. If type is ``submenu``, it should contain ``submenuContent`` instead of ``href``.
53
+
54
+
- If any item is to be disabled, we can pass optional ``disabled: true`` in that item object and
55
+
56
+
- If any item is to be active, we can pass optional ``isActive: true`` in that item object
57
+
58
+
secondaryMenuItems
59
+
******************
60
+
61
+
The secondary menu items has same structure as ``mainMenuItems``. On desktop screen, these items are displayed on the right of header just before the userMenu avatar and on mobile screen,
62
+
these items are displayed below the mainMenu items in dropdown.
63
+
64
+
Example:
65
+
::
66
+
67
+
[
68
+
{ type: 'item', href: '/help', content: 'Help' },
69
+
]
70
+
71
+
userMenuItems
72
+
*************
73
+
74
+
The user menu items is list of objects. On desktop screens, these items are displayed as a dropdown menu on the most right side of the header. The dropdown is opened by clicking on the avatar icon, which is typically located at the far right of the header.
75
+
On mobile screens, the user menu is also displayed as a dropdown menu, appearing under the avatar icon.
76
+
77
+
Each object represents a group in the user menu. Each object contains the ``heading`` and
78
+
list of menu items to be displayed in that group. Heading is optional and will be displayed only if passed. There can
79
+
be multiple groups. For a normal user menu, a single group can be passed with empty heading.
0 commit comments