Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

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

Closed
@chriddyp

Description

@chriddyp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions