Hi! So this works as expected and the first two options are selected by default:
app.layout = html.Div([dcc.Checklist(
id='checklist',
options={str(i): f'{10 + i}' for i in range(5)},
value=['0', '1'],
)
In this example, however, nothing is selected by default:
app.layout = html.Div([dcc.Checklist(
id='checklist',
options=[{'label': str(i), 'value': f'{10 + i}'} for i in range(5)],
value=['0', '1'],
)
This works as well:
app.layout = html.Div([dcc.Checklist(
id='checklist',
options=[{'label': str(i), 'value': f'{10 + i}'} for i in range(5)],
value=['10', '11'],
)
But I would like to use the labels instead.
By the way, this also doesn’t work (returns errors):
app.layout = html.Div([dcc.Checklist(
id='checklist',
options=[{'label': str(i), 'value': f'{10 + i}'} for i in range(5)],
value=[{'label': '10'}, {'label': '11'}],
)