✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Dash Bootstrap Components Tooltip Multiple Lines

Hey there, i try to format the tooltip text so that I have lines breaks. I tried “
” but this does not seem to work. What is the way to do this?

Best regards!

I had the same problem today and I believe I found a solution. Even though this is old, this might still help somebody in the future, I think.

Here is a code snipped:

import dash_bootstrap_components as dbc
import dash_core_components as dcc

dbc.Tooltip(dcc.Markdown('your first line\nyour second line', style={'white-space':'pre'}))

FYI, you can put a list of components as children of a dbc.Tooltip so you could do something like this as well:

    html.P("A first line"),
    html.P("A second line.")