dawidkopczyk / dash-admin-components

AdminLTE3 Dash components :zap:
http://dash-admin-components.opensource.quantee.ai/
Other
85 stars 21 forks source link

Adding content to each tab from TabBox #14

Open felipeboffnunes opened 3 years ago

felipeboffnunes commented 3 years ago

On the example given on the sourcem there is no connection between the text which was to display and the tabs. I don't know exactly how to add content to each tab from TabBox.

dac.TabItem(id='content_tab_cards', 

                    children=[

                        html.Div(
                            [ 
                                dac.TabBox(
                                    [
                                        dac.TabBoxHeader(
                                            dac.TabBoxMenu(
                                                [
                                                    dac.TabBoxMenuItem(tab_id='tab_box_1_tab1',
                                                                    label='Tab 1'),
                                                    dac.TabBoxMenuItem(tab_id='tab_box_1_tab2',
                                                                    label='Tab 2'),
                                                    dac.TabBoxMenuItem(tab_id='tab_box_1_tab3',
                                                                    label='Tab 3') 
                                                ],
                                                id='tab_box_1_menu'
                                            ),
                                            collapsible = True,
                                            title="Categories"
                                        ),
                                        dac.TabBoxBody(
                                            id='tab_box_1'
                                        )       
                                    ],
                                    width=12,
                                    elevation=2
                                ),
                            ], 
                            className='row'
                        )

                    ]
                )
felipeboffnunes commented 3 years ago

I realized I need to make a callback to retrieve the text depending on the id from the active tab. To be brief, this is too much work, a tab component like that should be able to store all the tabs inside the tabBody component and activate by id, being tab_id == id of a tabItem or alike.