New line or line break in tab title for Dash

Hello!

I have a tabs component with the following tab titles:

I’d like to put “(All Patients)” and “(Single Patient)” on a separate line in the tabs title. How can I do that?

I’ve tried using <br> or \n to no avail. The only “fix” is to specify padding, which is unideal as the titles will change dynamically. Is there a symbol or a way to add a line break character?

Hi @justin13601

Try adding: style={"white-space": "pre"}

dcc.Tab(
    label="Distribution Overview  \n(All Patients)",
    value="tab-1",
    style={"white-space": "pre"},
    selected_style={"white-space": "pre"},
)
2 Likes

Thank you so much!

1 Like