✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Can we actually disable checkboxes? This doesn't seem to work in my app

Does the “disabled” property of checkboxes work?

Are you speaking of a dcc.Checklist? Here is a code snipped I just tested (just insert it inside the layout of your app):

dcc.Checklist(
    options=[
        {'label': 'New York City', 'value': 'NYC', 'disabled':True},
        {'label': 'Montréal', 'value': 'MTL'},
        {'label': 'San Francisco', 'value': 'SF'}
    ],
    value=['MTL', 'SF']
)

In this example, only the New York City box is disabled but of course you can disable them all.

2 Likes

Hi Emmanuelle, this work fine. I think I had issues when I used the “disabled” property because I dynamically generate the checkboxes (checklist). I will try again and see if it works. Thanks!