dcc.Checklist: how to change the style of one label, which I dont want to be displayed?

Hello there,

The question is in the title,

I have the below standard dcc.Checkbox:

html.Div(
    [
        dcc.Checklist(
            id="CheckListToFillDropdownByCateg",
            options=[
                {'label': 'A', 'value': 'CatA'},
                {'label': 'B', 'value': 'CatB'},
                {'label': 'C', 'value': 'CatC'},
                {'label': 'D', 'value': 'CatD'},
                {'label': 'E', 'value': 'CatE'},
                {'label': 'F', 'value': 'CatF'},
                {'label': 'More', 'value': 'More'},
                {'label': 'Default', 'value': 'Default'},
            ],
            values=['CatD', CatF'],
            inputStyle={"vertical-align":"middle", "margin":"auto"},
            labelStyle={"vertical-align":"middle"},
            style={"display":"inline-flex", "flex-wrap":"wrap", "justify-content":"space-between","line-height":"28px"},
                            
        )                                  
    ],className="row",
),

labelStyle is applied to every label. How can I apply this style to label 1 to 7, and have another style for the last label?

The solution I’m thinking about is making a dcc.Checklist with 7 labels, and another dcc.Checklist with just one, hidden. Is there another way ?

Hey David,

So since this is a DCC, I would just add an Output that changes the style in your app.callback.

For example:

@app.callback(
    [Output('original-output','figure'),
    Output('CheckListToFillDropdownByCateg','style')],
    [Input('CheckListToFillDropdownByCateg','value')]
)
def update_figure(value):
    fig = func(value) #whatever you do to return the original figure
    if value != "Default":
        check_style = {#style attribute#}
    else:
        check_style = {#style attribute#}
    return [fig, check_style]