You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
I'm developing a webapp which needs to have checkboxes that contain another (Dash's) React
component, so I've modified the Checklist component to allow to include options with children components, as well as a button to show/hide those children.
Here is a short "demo":
This is a first approach, so take it as a prototype. We can work on it and improve it until it reaches a production-ready code and then we can squash all commits and merge with master.
Thanks @Akronix ! I think that this is out of the scope for this core checkbox component - I'd like to keep the options as simple possible and this feels like a more specialized UI that would be better suited in a fork (something like CollapsableChecklist).
Another note - once something like plotly/dash-renderer#26 is added, this behaviour will be able to be specified with something like:
dcc.CheckList(options=[
{
'value': 'melons',
'label': html.Details([
html.Summary('Label of the item'),
html.Div(html.Img(src='...'), html.Div('More about the mango option')
])
}
])
In other words, we'll be able to allow the user to supply any component as the label, not just strings. In this case, the html.Details component hides and shows content but users could supply any type of label: html.H1, html.Img, etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm developing a webapp which needs to have checkboxes that contain another (Dash's) React
component, so I've modified the Checklist component to allow to include options with children components, as well as a button to show/hide those children.
Here is a short "demo":

This is a first approach, so take it as a prototype. We can work on it and improve it until it reaches a production-ready code and then we can squash all commits and merge with master.