Font-awesome in label for dcc.Tab

I wonder if it is possible to use font-awesome icons in a label (in addition to a text) for dcc.Tab component. I have managed to use it for buttons, like this:

html.Button(['Submit', html.I(className="fas fa-calculator")], id='submit-button')

but it does not work when I do something similar in dcc.Tab:

dcc.Tab(label=['Results', html.I(className="fas fa-chart-bar")])

Does anybody have a solution for that?

3 Likes

Hi Sergio,

Your code should work if you write:
dcc.Tab(label=‘Results’, labelClassName=‘fas fa-chart-bar’)
For me at least it did :wink:

Cheers,
Michaela

2 Likes

Thank you @michkouk. For the record, this works with dbc.Tab as well.

1 Like