Expand commentComment on line R9Resolved

Header

The header is a structural component placed at the top of the interface. It provides global access to navigation, branding, and user actions, ensuring consistency and orientation across products and applications.

The header is part of the application layout, so it can only be used inside of it. Please check the DxcApplicationLayout documentation.

Props

NameTypeDescriptionDefault
New
appTitle
stringString used to configure the header application title.-
New
navItems
(GroupItem | Item)[]Array of navigation items to be displayed in the header navigation menu. Each item can be a single/simple item or a group item.

Being Item an object with the following properties:

{ badge?: ReactElement; icon?: string | SVG; label: string; onSelect?: () => void; selected?: boolean; }

and GroupItem an object with the following properties:

{ badge?: ReactElement; icon?: string | SVG; label: string; items: (Item)[]; }
Group items will ignore any nested group items to maintain a maximum of two levels in the navigation menu. When responsive, navigation items will be displayed in a vertical menu below the header in a vertical layout.
-
New
responsiveBottomContent
React.ReactNodeThe content rendered in the bottom part of the header menu under the navigation items when in responsive mode.-
New
searchBar
{ onBlur: (value: string) => void; onCancel: () => void; onChange: (value: string) => void; onEnter: (value: string) => void; placeholder?: string; }
When provided, a search bar trigger is shown at the start of the side content. Activating the trigger expands the search bar, enabling search interactions.

In responsive mode, the search bar is displayed directly (without a trigger), and the onCancel callback is not called.

-
New
sideContent
React.ReactNode | (isResponsive: boolean) => React.ReactNodeContent to be displayed on the right side of the header. It can be a ReactNode or a function that receives a boolean indicating if the header is in responsive mode and returns a ReactNode.-

Examples

Header in application layout