cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TitleBar.Title component does not automatically center

MaximilianoML
Helper

Hello, Dev Friends!

Today I was changing some titles in my Custom App and then I realized that my TitleBar.Title component was no rendering with the right style, I'll attach 3 images to explain my point.

My component rendered:

MaximilianoML_0-1722519459224.png

My code snippet:

MaximilianoML_1-1722519718626.png

A Dynatrace example of how I want to look like:

MaximilianoML_2-1722519794405.png

Thank you for your attention 🙂

 

 

 

Fullstack developer | Tech Lover
2 REPLIES 2

educampver
Dynatrace Advisor
Dynatrace Advisor

Hi @MaximilianoML, the issue is that the icon is taller than the level 3 heading. As I see it you have two options:

  1. Remove the heading component and leave the content inside the <TitleBar.Title> component. With this option the font size will be larger and cover the whole height of the title bar.
  2. If you must keep the smaller font size, you can add custom styles to the <TitleBar.Title> component. Something like this should work:

 

// App.css
.app-title {
    display: flex;
    align-items: center;
    height: 100%;
}

// App.tsx
import './App.css

<TitleBar.Title className="app-title">
    <Heading level={5}>Cost and Trafic Control</Heading>
</TitleBar.Title>

 

MaximilianoML
Helper

Hi @educampver !

Great! I can't believe I was styling the wrong component hahahaha 

Thank you for your help, my friend!

Have a great day 🙂

Maximiliano Lopes

Fullstack developer | Tech Lover

Featured Posts