Chapter 11. Customizing Red Hat Developer Hub appearance
Chapter 11. Customizing Red Hat Developer Hub appearance
By modifying the visual aspects of the interface, organizations can align Red Hat Developer Hub with their branding guidelines and improve the overall user experience.
The following default theme configurations are available for Red Hat Developer Hub:
Default theme configurations to make your developer portal look like a standard Backstage instance. For more information, see Section 11.10, “Default Backstage theme”
You can change or disable particular parameters in a default theme or create a fully customized theme by modifying the app-config-rhdh.yaml file. From the app-config-rhdh.yaml file, you can customize common theme components, including the following components:
Company name and logo
Font color, size, and style of text in paragraphs, headings, headers, and buttons
Header color, gradient, and shape
Button color
Navigation indicator color
You can also customize some components from the Developer Hub GUI, such as the theme mode (Light Theme, Dark Theme, or Auto).
You can choose one of the following theme modes for your Developer Hub instance:
Light
Dark
Auto
Note
In Developer Hub, theme configurations are used to change the look and feel of different UI components. So, you might notice changes in different UI components, such as buttons, tabs, sidebars, cards, and tables along with some changes in background color and font used on the RHDH pages.
The default theme mode is Auto, which automatically sets the light or dark theme based on your system preferences.
Prerequisites
You are logged in to the Developer Hub web console.
Procedure
From the Developer Hub web console, click Settings.
From the Appearance panel, click Light, Dark, or Auto to change the theme mode.
You can customize the branding logo of your Developer Hub instance by configuring the branding section in the app-config.yaml file, as shown in the following example:
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Replace image/svg+xml with the correct media type for your image (for example, image/png and image/jpeg), and adjust the file extension accordingly. As a result, you can embed the logo directly without referencing an external file.
You can also customize the width of the branding logo by setting a value for the fullLogoWidth field in the branding section, as shown in the following example:
app:
branding:
fullLogoWidth: 110px
# ...
app:branding:fullLogoWidth: 110px
# ...
Copy to ClipboardCopied!Toggle word wrapToggle overflow
fullLogoWidth
The default value for the logo width is 110px. The following units are supported: integer, px, em, rem, percentage.
The sidebar menu in Red Hat Developer Hub consists of two main parts that you can configure:
Dynamic plugin menu items
Your preferences and your active plugins define dynamically one part of the sidebar menu.
Main menu items
The core navigation structure of sidebar is static.
Dynamic plugin menu items: These items are displayed beneath the main menu and can be customized based on the plugins installed. The main menu items section is dynamic and can change based on your preferences and installed plugins.
Customize the main menu items using the following steps:
Procedure
Open the app-config.yaml file.
To customize the order and parent-child relationships for the main menu items, use the dynamicPlugins.frontend.default.main-menu-items.menuItems field.
For dynamic plugin menu items, use the dynamicPlugins.frontend.<package_name>.menuItems field.
Example app-config.yaml file
dynamicPlugins:
frontend:
default.main-menu-items:
menuItems:
default.home:
title: Home
icon: home
priority: 100
enabled: true
default.my-group:
title: My Group
icon: group
priority: 90
enabled: true
default.catalog:
title: Catalog
icon: category
to: catalog
priority: 80
enabled: true
default.apis:
title: APIs
icon: extension
to: api-docs
priority: 70
enabled: true
default.learning-path:
title: Learning Paths
icon: school,
to: learning-paths
priority: 60
enabled: true
default.create:
title: Self-service
icon: add
to: create
priority: 50
enabled: true
dynamicPlugins:frontend:default.main-menu-items:menuItems:default.home:title: Home
icon: home
priority:100enabled:truedefault.my-group:title: My Group
icon: group
priority:90enabled:truedefault.catalog:title: Catalog
icon: category
to: catalog
priority:80enabled:truedefault.apis:title: APIs
icon: extension
to: api-docs
priority:70enabled:truedefault.learning-path:title: Learning Paths
icon: school,to: learning-paths
priority:60enabled:truedefault.create:title: Self-service
icon: add
to: create
priority:50enabled:true
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Configure a dynamic plugin menu item using the following step:
Procedure
In the app-config.yaml file, update the menuItems section of your <plugin_name> plugin. For example:
dynamicPlugins:
frontend:
_<plugin_name>_:
menuItems:
<menu_item_name>:
icon: # home | group | category | extension | school | _<my_icon>_
title: _<plugin_page_title>_
priority: 10
parent: favorites
enabled: true
dynamicPlugins:frontend:_<plugin_name>_:menuItems:<menu_item_name>:icon:# home | group | category | extension | school | _<my_icon>_title: _<plugin_page_title>_
priority:10parent: favorites
enabled:true
Copy to ClipboardCopied!Toggle word wrapToggle overflow
<plugin_name>
Enter the plugin name. This name is the same as the scalprum.name key in the package.json file.
<menu_item_name>
Enter a unique name in the main sidebar navigation for either a standalone menu item or a parent menu item. If this field specifies a plugin menu item, the name of the menu item must match the name using in the corresponding path in dynamicRoutes. For example, if dynamicRoutes defines path: /my-plugin, then menu_item_name must be defined as my-plugin.
icon
(Optional) Enter the icon name. You can use any of the following icons:
Default icons, such as home, group, category, extension, and school. To use default icons, set the icon as an (" ") empty string.
A custom icon, where <my_icon> specifies the name of your custom icon
An SVG icon, such as: icon: <svg width="20px" height="20px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill="#ffffff">…</svg>
(Optional) Enter the menu item title. Omit it when the title is already specified in the dynamicRoutes configuration under menuItem.text. To hide the title from the sidebar, set the title as an (" ") empty string.
priority
(Optional) Sets the order in which menu items appear in the sidebar. The default priority is 0, which places the item at the bottom of the list. A higher priority value places the item higher in the sidebar. You can define this field for each section.
parent
(Optional) Enter the parent menu item under which the current item is nested. If this field is used, the parent menu item must be defined elsewhere in the menuItems configuration of any enabled plugin. You can define this field for each section.
enabled
(Optional) If this field is used to hide the menu item from the sidebar, set the value to false. To display the menu item in the sidebar, set the value to true.
Modify a main menu item or add a custom menu item using the following step:
Procedure
In the app-config.yaml file, add a section to the default.main-menu-items > menuItems section. Use the default. prefix to identify the key as a main menu item.
dynamicPlugins:
frontend:
default.main-menu-items:
menuItems:
default._<menu_group_parent_item_name>_:
icon: # home | group | category | extension | school | _<my_icon>_
title: _<menu_group_parent_title>_
priority: 10
default._<menu_item_name>_:
parent: _<menu_group_parent_item_name>_
icon: # home | group | category | extension | school | _<my_icon>_
title: _<my_menu_title>_
to: _<path_to_the_menu_target_page>_
priority: 100
enabled: true
dynamicPlugins:frontend:default.main-menu-items:menuItems:default._<menu_group_parent_item_name>_:icon:# home | group | category | extension | school | _<my_icon>_title: _<menu_group_parent_title>_
priority:10default._<menu_item_name>_:parent: _<menu_group_parent_item_name>_
icon:# home | group | category | extension | school | _<my_icon>_title: _<my_menu_title>_
to: _<path_to_the_menu_target_page>_
priority:100enabled:true
Copy to ClipboardCopied!Toggle word wrapToggle overflow
default.<menu_group_parent_item_name>
(Optional) Enter the menu group parent item name to configure static main menu items. If no default.<menu_item_name> has a parent value set, this field is not needed.
icon
Enter the menu icon. Required for parent menu items.
title
Enter the menu group title. Required for parent menu items.
priority
(Optional) Enter the order of this menu item within its menu level.
default.<menu_item_name>
Enter the menu item name for which you want to override the default value. Add the default. prefix to identify a main menu item.
parent
(Optional) Enter the parent menu item for this item. Required if <menu_item_name> is specified as the child of any menu items.
icon
(Optional) Enter the menu icon. To use the default icon, set the icon as an (" ") empty string.
title
(Optional) Enter the menu group title. Only required for adding a new custom main menu item. To hide a default main menu item title from the sidebar, set the title as an (" ") empty string.
to
(Optional) Enter the path that the menu item navigates to. If it is not set, it defaults to the home page.
priority
(Optional) Enter the order of this menu item within its menu level.
enabled
(Optional) If this field is used to display the menu item in the sidebar, set the value to true. To hide the menu item from the sidebar, set the value to false.
default.main-menu-items:
menuItems:
default.catalog:
icon: category
title: My Catalog
priority: 5
default.learning-path:
title: ''
default.parentlist:
title: Overview
icon: bookmarks
default.home:
parent: default.parentlist
default.references:
title: References
icon: school
to: /references
enabled: true
default.main-menu-items:menuItems:default.catalog:icon: category
title: My Catalog
priority:5default.learning-path:title:''default.parentlist:title: Overview
icon: bookmarks
default.home:parent: default.parentlist
default.references:title: References
icon: school
to: /references
enabled:true
Copy to ClipboardCopied!Toggle word wrapToggle overflow
icon
Specifies if you want to change the icon default menu item for the catalog.
title
Specifies an empty string " " to hide the learning path from the default sidebar.
default.parentlist
Introduces the parent menu item.
parent
Nests home menu under the default.parentlist parent menu item.
title
Specifies a name for default.references
icon
Displays the school icon.
to
Redirects default.references to the /references page.
enabled
(Optional) If this field is used to display the menu item in the sidebar, set the value to true. To hide the menu item from the sidebar, set the value to false.
Red Hat Developer Hub provides a default opinionated tab set for catalog entity views. For consistency with your organization needs, you can rename, reorder, remove, and add tab titles.
Procedure
For each tab to modify, enter your desired values in the entityTabs section in your app-config.yaml file:
Each Red Hat Developer Hub entity detail tab has a default opinionated layout. For consistency with your organization needs, you can change the entity detail tab content when the plugin that contributes the tab content allows a configuration.
Copy to ClipboardCopied!Toggle word wrapToggle overflow
package
Enter your package location, such as ./dynamic-plugins/dist/backstage-community-plugin-tekton.
<plugin_name>
Enter your plugin name, such as: backstage-community.plugin-tekton.
mountPoint
Copy the mount point defined in the plugin default configuration, such as: entity.page.ci/cards.
importName
Copy the import name defined in the plugin default configuration, such as: TektonCI.
layout
Enter your layout configuration. The tab content is displayed in a responsive grid that uses a 12 column-grid and supports different breakpoints (xs, sm, md, lg, xl) that can be specified for a CSS property, such as gridColumn. The example uses 6 of the 12 columns to show two Tekton CI cards side-by-side on large (lg) screens (span 6 columns) and show them among themselves (xs and above span 12 columns).
You can customize the color palettes of the light and dark theme modes in your Developer Hub instance by configuring the light.palette and dark.palette parameters in the branding.theme section of the app-config.yaml file, as shown in the following example:
Copy to ClipboardCopied!Toggle word wrapToggle overflow
light:palette:primary:main
The main primary color for the light color palette, for example, #ffffff or white
light:palette:navigation:indicator
The color of the navigation indicator for the light color palette, which is a vertical bar that indicates the selected tab in the navigation panel, for example, #FF0000 or red
light:pageTheme:default:backgroundColor
The background color for the default page theme for the light color palette, for example, #ffffff or white
dark:palette:primary:main
The main primary color for the dark color palette, for example, #000000 or black
dark:palette:navigation:indicator
The color of the navigation indicator for the dark color palette, which is a vertical bar that indicates the selected tab in the navigation panel, for example, #FF0000 or red
dark:pageTheme:default:backgroundColor
The background color for the default page theme for the dark color palette, for example, #000000 or black
You can customize the header color for the light and dark theme modes in your Developer Hub instance by modifying the branding.theme section of the app-config.yaml file. You can also customize the page headers for additional Developer Hub pages, such as the Home, Catalog, and APIs pages.
Copy to ClipboardCopied!Toggle word wrapToggle overflow
light
The theme mode, for example, light or dark
default
The yaml header for the default page theme configuration
backgroundColor
The color of the page header background, for example, #ffffff or white
fontColor
The color of the text in the page header, for example, #000000 or black
shape
The pattern on the page header, for example, wave, round, or noneapis:: The yaml header for a specific page theme configuration, for example, apis, home
You can configure the typography section of the app-config.yaml file to change the default font family and size of the page text, as well as the font family and size of each heading level, as shown in the following example:
app:
branding:
theme:
light:
typography:
fontFamily: "Times New Roman"
htmlFontSize: 11 # smaller is bigger
h1:
fontFamily: "Times New Roman"
fontSize: 40
h2:
fontFamily: "Times New Roman"
fontSize: 30
h3:
fontFamily: "Times New Roman"
fontSize: 30
h4:
fontFamily: "Times New Roman"
fontSize: 30
h5:
fontFamily: "Times New Roman"
fontSize: 30
h6:
fontFamily: "Times New Roman"
fontSize: 30
dark:
typography:
fontFamily: "Times New Roman"
htmlFontSize: 11 # smaller is bigger
h1:
fontFamily: "Times New Roman"
fontSize: 40
h2:
fontFamily: "Times New Roman"
fontSize: 30
h3:
fontFamily: "Times New Roman"
fontSize: 30
h4:
fontFamily: "Times New Roman"
fontSize: 30
h5:
fontFamily: "Times New Roman"
fontSize: 30
h6:
fontFamily: "Times New Roman"
fontSize: 30
# ...
app:branding:theme:light:typography:fontFamily:"Times New Roman"htmlFontSize:11# smaller is biggerh1:fontFamily:"Times New Roman"fontSize:40h2:fontFamily:"Times New Roman"fontSize:30h3:fontFamily:"Times New Roman"fontSize:30h4:fontFamily:"Times New Roman"fontSize:30h5:fontFamily:"Times New Roman"fontSize:30h6:fontFamily:"Times New Roman"fontSize:30dark:typography:fontFamily:"Times New Roman"htmlFontSize:11# smaller is biggerh1:fontFamily:"Times New Roman"fontSize:40h2:fontFamily:"Times New Roman"fontSize:30h3:fontFamily:"Times New Roman"fontSize:30h4:fontFamily:"Times New Roman"fontSize:30h5:fontFamily:"Times New Roman"fontSize:30h6:fontFamily:"Times New Roman"fontSize:30# ...
Copy to ClipboardCopied!Toggle word wrapToggle overflow
You can use the default Red Hat Developer Hub theme configurations to make your Developer Hub instance look like a standard Red Hat Developer Hub instance. You can also modify the app-config.yaml file to customize or disable particular parameters.
You can use the default Backstage theme configurations to make your Developer Hub instance look like a standard Backstage instance. You can also modify the app-config.yaml file to customize or disable particular parameters.
Copy to ClipboardCopied!Toggle word wrapToggle overflow
id
Set your theme ID by specifying the desired value. Optionally, override the default Developer Hub themes by using the following ID values: light to replace the default light theme, or dark to replace the default dark theme.
Verification
The theme is available in the Developer Hub Settings page.
There are two component variants that you can use to customize various components of your Developer Hub theme:
Patternfly
MUI
In addition to assigning a component variant to each parameter in the light or dark theme mode configurations, you can toggle the rippleEffecton or off.
The following code shows the options that you can use in the app-config.yaml file to configure the theme components for your Developer Hub instance:
app:
branding:
theme:
light:
options:
rippleEffect: off / on
paper: patternfly / mui
buttons: patternfly / mui
inputs: patternfly / mui
accordions: patternfly / mui
sidebars: patternfly / mui
pages: patternfly / mui
headers: patternfly / mui
toolbars: patternfly / mui
dialogs: patternfly / mui
cards: patternfly / mui
tables: patternfly / mui
tabs: patternfly / mui
dark:
options:
rippleEffect: off / on
paper: patternfly / mui
buttons: patternfly / mui
inputs: patternfly / mui
accordions: patternfly / mui
sidebars: patternfly / mui
pages: patternfly / mui
headers: patternfly / mui
toolbars: patternfly / mui
dialogs: patternfly / mui
cards: patternfly / mui
tables: patternfly / mui
tabs: patternfly / mui
app:branding:theme:light:options:rippleEffect: off / on
paper: patternfly / mui
buttons: patternfly / mui
inputs: patternfly / mui
accordions: patternfly / mui
sidebars: patternfly / mui
pages: patternfly / mui
headers: patternfly / mui
toolbars: patternfly / mui
dialogs: patternfly / mui
cards: patternfly / mui
tables: patternfly / mui
tabs: patternfly / mui
dark:options:rippleEffect: off / on
paper: patternfly / mui
buttons: patternfly / mui
inputs: patternfly / mui
accordions: patternfly / mui
sidebars: patternfly / mui
pages: patternfly / mui
headers: patternfly / mui
toolbars: patternfly / mui
dialogs: patternfly / mui
cards: patternfly / mui
tables: patternfly / mui
tabs: patternfly / mui
Copy to ClipboardCopied!Toggle word wrapToggle overflow
We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.
About Red Hat
We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.