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 ``logo``, ``mainMenuItems``,
10
+
``secondaryMenuItems``, and ``userMenuItems`` props. If props are provided, the component will use them; otherwise,
11
+
If any of the props ``(logo, mainMenuItems, secondaryMenuItems, userMenuItems)`` are not provided, default
12
+
items are 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
+
``logo``
21
+
*******
22
+
23
+
The logo prop is an object containing `src`, `alt`, and `href` properties. If not passed, LOGO_URL from config will be used.
24
+
It is displayed on the left of the header in the desktop screen and in the center of the header on the mobile screen.
25
+
26
+
Example:
27
+
::
28
+
29
+
{
30
+
src: 'path/to/logo.png',
31
+
alt: 'Logo Alt Text',
32
+
href: '/home'
33
+
}
34
+
35
+
``mainMenuItems``
36
+
*****************
37
+
38
+
The main menu items is a list of menu items objects. On desktop screens, these items are displayed on the left, to the right of the logo icon and to the left of the secondary menu.
39
+
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.
- The ``type`` should be ``item`` or ``submenu``. If type is ``submenu``, it should contain ``submenuContent`` instead of ``href``.
61
+
62
+
- If any item is to be disabled, we can pass optional ``disabled: true`` in that item object and
63
+
64
+
- If any item is to be active, we can pass optional ``isActive: true`` in that item object
65
+
66
+
secondaryMenuItems
67
+
******************
68
+
69
+
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,
70
+
these items are displayed below the mainMenu items in dropdown.
71
+
72
+
Example:
73
+
::
74
+
75
+
[
76
+
{ type: 'item', href: '/help', content: 'Help' },
77
+
]
78
+
79
+
userMenuItems
80
+
*************
81
+
82
+
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.
83
+
On mobile screens, the user menu is also displayed as a dropdown menu, appearing under the avatar icon.
84
+
85
+
User Menu is list of objects. Each object represent a group in user menu. Each object contains the ``heading`` and
86
+
list of menu items to be displayed in that group. Heading is optional and will be displayed only if passed. There can
87
+
be multiple groups. For a normal user menu, we can pass single group with empty heading.
0 commit comments