How to populate a hoverplate with a value (split in two lines) in Plotly?

This is quite a special use case, but since I don’t mange to find a solution I decide to ask.

I am using the hoverplate to display information contained in custom_data=['custom'] that is:

info 1 |x| info 2

But I would need to display the info in two lines inside of the hoverplate such as:


This is the script illustrating the exercise;

import pandas as pd
import as px

data = {'site': {1: 'Site 1', 2: 'Site 2', },
        'link': {1: '', 2: ''},
        'custom': {1: 'info 1 |x| info 2', 2: 'info 1 |x| info 2'},
        'popularity': {1: 50, 2: 50}}

df = pd.DataFrame(data)

fig = px.sunburst(df,
                  path=['site', 'link'],


Hi @LouizZanjroz,

maybe I am missing something but does this create the desired result?

'custom': {1: 'info 1 <br>info 2', 2: 'info 1 |x| info 2'},

Hi @AIMPED - you are spot on - the solution was simpler than I thought it was. Many thanks.