Dbc Checklist - switch - component - size and font

Hi there,

I am using the dash bootstrap component Checklist, and I am wondering if it is possible to:

  • make the switch smaller
  • change the font size of the text, i.e. make it smaller
dbc.Checklist(id='Checklist_switch',
                                options=[{'label': 'On','value': 'switch_is_on'},],
                                value=[],
                                switch=True,
                                ),

maybe with ‘className’ or ‘style’ ?

Thanks!

You can give Switch a try if you are open to using another component library. It’s pretty straightforward to customise the size, radius, colour, etc. of a switch in dmc.

Hey Snehilvj,

thanks for your reply, great stuff, I will give it a try.

In the meanwhile I have found a sort of solution, setting the style to small font size reduce also the size of the switch, like:

dbc.Checklist(id='general_id',
               switch=True,
               options=[
                {'label': 'small_switch',
                'value': 'On'},
                ],
                value=[],
                style={'fontSize':10},),```