A StackLayout subclass that uses tabs to let the user select a child widget.


from flexx import app, ui

class Example(ui.Widget):
    def init(self):
        with ui.TabLayout() as self.t:
            self.a = ui.Widget(title='red', style='background:#a00;')
            self.b = ui.Widget(title='green', style='background:#0a0;')
            self.c = ui.Widget(title='blue', style='background:#00a;')
open in new tab

Also see examples:

class flexx.ui.TabLayout(*init_args, **kwargs)

Inherits from: StackLayout

A StackLayout which provides a tabbar for selecting the current widget. The title of each child widget is used for the tab label.

The node of this widget is a <div>. The visible child widget fills the entire area of this element, except for a small area at the top where the tab-bar is shown.

emitters: user_current


emitter – Event emitted when the user selects a tab. Can be used to distinguish user-invoked from programatically-invoked tab changes. Has old_value and new_value attributes.