Chapter 6. Configuring the global header in Red Hat Developer Hub
As an administrator, you can configure the Red Hat Developer Hub global header to create a consistent and flexible navigation bar across your Developer Hub instance. By default, the Developer Hub global header includes the following components:
- Create button provides quick access to a variety of templates, enabling users to efficiently set up services, backend and front-end plugins within Developer Hub
- Support button that can link an internal or external support page
- Notifications button displays alerts and updates from plugins and external services
- Search input field allows users to find services, components, documentation, and other resources within Developer Hub
- Plugin extension capabilities provide a preinstalled and enabled catalog of available plugins in Developer Hub
- User profile drop-down menu provides access to profile settings, appearance customization, Developer Hub metadata, and a logout button
6.1. Customizing your Red Hat Developer Hub global header Copy linkLink copied to clipboard!
You can use the red-hat-developer-hub.backstage-plugin-global-header
dynamic plugin to extend the global header with additional buttons and customize the order and position of icons and features. Additionally, you can create and integrate your custom dynamic header plugins using the mount points provided by this new header feature, allowing you to further tailor to suit your needs. For more information on enabling dynamic plugins, see Installing and viewing plugins in Red Hat Developer Hub.
Default global header configuration
- 1
- search: Hides the Search modal in the sidebar menu. Change it to
true
to display the Search modal in the sidebar. - 2
- settings: Hides the Settings button in the sidebar menu. Change it to
true
to display the Settings button in the sidebar. - 3
default.main-menu-items
: Hides the Create button from the sidebar menu. Remove this field to display the Create button in the sidebar.- 4
- position: Defines the position of the header. Options:
above-main-content
orabove-sidebar
.
To extend the functionality of the default global header, include any the following attributes in your global header entry:
mountPoint
-
Specifies the location of the header. Use
application/header
to specify it as a global header. You can configure several global headers at different positions by adding entries to themountPoints
field. importName
Specifies the component exported by the global header plugin.
The
red-hat-developer-hub.backstage-plugin-global-header
package (enabled by default) offers the following header components as possible mount point values:-
SearchComponent
: Adds a search bar (enabled by default). -
Spacer
: Adds spacing in the header to position buttons at the end. Useful when you disableSearchComponent
. -
HeaderIconButton
: Adds an icon button. By default, the Create icon button remains enabled. -
SupportButton
: Adds a Support icon button, allowing users to configure a link to an internal or external page. Enabled by default but requires additional configuration to display. -
NotificationButton
: Adds a Notifications icon button to display unread notifications in real time and navigate to the Notifications page. Enabled by default (requires the notifications plugin). -
Divider
: Adds a vertical divider. By default, a divider appears between the profile dropdown and other header components. -
ProfileDropdown
: Adds a profile dropdown showing the logged-in user’s name. By default, it contains two menu items. -
MenuItemLink
: Adds a link item in a dropdown menu. By default, the profile dropdown includes a link to the Settings page. -
LogoutButton
: Adds a logout button in the profile dropdown (enabled by default). -
CreateDropdown
: Adds a Create dropdown button (disabled by default). The menu items are configurable. -
SoftwareTemplatesSection
: Adds a list of software template links to the Create dropdown menu (disabled by default). You must enableCreateDropdown
. -
RegisterAComponentSection
: Adds a link to the Register a Component page in the Create dropdown menu (disabled by default). You must enableCreateDropdown
.
-
config.position
-
Specifies the position of the header. Supported values are
above-main-content
andabove-sidebar
.
Prerequisites
-
You must configure the support URL in the
app-config.yaml
file to display the Support button in the header. - You must install the notifications plugin to display the Notifications button in the header.
Procedure
Copy the default configuration and modify the field values to suit your needs. You can adjust the
priority
value of each header component to control its position. Additionally, you can enable or disable components by adding or removing them from the configuration. To ensure that the remaining header buttons align with the end of the header before the profile dropdown button, setconfig.props.growFactor
to1
in theSpacer
mount point to enable theSpacer
component. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow To use your custom header, you must install it as a dynamic plugin by adding your plugin configuration to your
app-config-dynamic.yaml
file. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow where:
- <npm_or_oci_package-reference>
- Specifies the package name.
- <application_header_name>
-
Specifies the name of the application header. For example:
MyHeader
- <header_component_name>
Specifies the name of the header component. For example:
MyHeaderComponent
NoteimportName
is an optional name referencing the value returned by the scaffolder field extension API.
Optional: To disable the global header, set the value of the
disabled
field totrue
in yourdynamic-plugins.yaml
file. For example:- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header disabled: true
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header disabled: true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2. Mount points for dynamic plugin integration Copy linkLink copied to clipboard!
You can customize the application header in Developer Hub using mount points for dynamic plugins. These mount points give flexibility in configuring the position of the header, its components and dropdown menus. You can create a customized experience with the following enhancements:
- application/header
-
Controls the header position. Use
config.position
to set placement as eitherabove-main-content
orabove-sidebar
. - global.header/component
Configures header components. Use
config.priority
to set the order of components, and pass properties (including CSS styles) viaconfig.props
.Example adding a Self-service button
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example adding a spacer element
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example adding a divider element
mountPoints: - mountPoint: global.header/component importName: Divider config: priority: 150
mountPoints: - mountPoint: global.header/component importName: Divider config: priority: 150
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - global.header/profile
Configures the profile dropdown list when the
ProfileDropdown
component is enabled.Example adding a settings link to the profile dropdown
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - global.header/create
Configures the create dropdown list when the
CreateDropdown
component is enabled.Example adding a section for registering a component
- mountPoint: global.header/create importName: RegisterAComponentSection config: props: growFactor: 0
- mountPoint: global.header/create importName: RegisterAComponentSection config: props: growFactor: 0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow