Skip to content
Discussion options

You must be logged in to vote

Try this:

from nicegui import ui

def index():
    ui.label('Main')
    ui.separator()
    ui.sub_pages(
        {
            '/':main,
            '/a':a,
            '/b':b
        }
    )

def main():
    ui.link('Page A','/a')
    ui.link('Page B','/b')

def a():
    ui.query('.nicegui-sub-pages').classes('w-full')
    ui.link('Page Main','/').classes('bg-red w-full')
    ui.link('Page B','/b')

def b():
    ui.link('Page Main','/')
    ui.link('Page A','/a')

ui.run(root=index)

Or this:

from nicegui import ui

ui.sub_pages.default_classes('w-full')

def index():
    ui.label('Main')
    ui.separator()
    ui.sub_pages(
        {
            '/':main,
            '/a':a,
            '…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by falkoschindler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants