Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use children instead of label in dcc.Tab? #247

Closed
chriddyp opened this issue Jul 30, 2018 · 1 comment
Closed

Use children instead of label in dcc.Tab? #247

chriddyp opened this issue Jul 30, 2018 · 1 comment

Comments

@chriddyp
Copy link
Member

In Dash, the only property that can accept arbitrary components is the children property.

I think we should add support for children in dcc.Tab, rather than label. That is:

dcc.Tab(
    children=html.Div(...)
)

rather than

dcc.Tab(
    label='Tab 2'
)

This will allow our users to render more flexible content within their tab. I imagine most folks will just use the default styles and just pass in text, but if we allow children then users could pass in more flexible content like images or icons.

This was originally mentioned in #213 (comment) but it looks like it wasn't clear enough. In this commit, the propType changed but I was actually referring to the property name itself: 8583ec6#diff-e23b57179f41430c617387f03d67ca9fR21

Since we've released, we have to keep supporting the label property. So, we'll have to check if children is supplied and if not, use the existing label

@chriddyp
Copy link
Member Author

Ah nevermind, children is reserved for the actual tab's content.

So, we'll have to table label until we have dash 2.0.0, when we can render arbitrary components as arbitrary properties, not just the children prop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants