Skip to content

Tabs with dropdown buttons #3076

Closed Answered by falkoschindler
kewartoscar asked this question in Q&A
Discussion options

You must be logged in to vote

I see. Here's an example using a ui.dropdown_button:

with ui.tabs() as tabs:
    one = ui.tab('One')
    two = ui.tab('Two')
    with ui.dropdown_button('More', auto_close=True).props('flat square color=black').classes('h-full'):
        ui.item('Three', on_click=lambda: tabs.set_value('three'))
        ui.item('Four', on_click=lambda: ui.open('/four'))
with ui.tab_panels(tabs, value=one).classes('w-full'):
    with ui.tab_panel(one):
        ui.label('First tab')
    with ui.tab_panel(two):
        ui.label('Second tab')
    with ui.tab_panel('three'):
        ui.label('Third tab')

I wasn't sure if you want to open pages or tabs, so I'm showing both.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@kewartoscar
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by kewartoscar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
community question A question for the NiceGUI community
2 participants