Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Superscripts in labels in dash-core-components RadioItems

To put superscripts in the labels of RadioItems, I found I could use a Unicode string like this:

            options = [{'label': u'10\u00b9\u00b9', 'value': 1.e11},
                           {'label': u'10\u00b9\u00b2', 'value': 1.e12},
                           {'label': u'10\u00b9\u00b3', 'value': 1.e13}],

Is this the only option for formatting of the labels?

Hm, that’s a good question. For the moment, I believe that this is the only solution. In the future, we may have an “html renderer” option for dropdowns which would all you to specify something like [10, html.Sup(9)] or maybe even 10<sup>9</sup>. This <sup> (“superscript”) syntax is what we use in plotly.js (https://help.plot.ly/adding-HTML-and-links-to-charts/)