Label

Simple example:

label = ui.Label(text='This is a label')
open in new tab

Interactive example:

from flexx import app, ui, event

class Example(ui.Widget):

    def init(self):
        with ui.HBox():
            self.but = ui.Button(text='Push me')
            self.label = ui.Label(flex=1, wrap=True, text='This is a label. ')

    class JS:
        @event.connect('but.mouse_down')
        def _add_label_text(self, *events):
            self.label.text = self.label.text + 'Yes it is. '
open in new tab


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

Inherits from: Widget

Widget to show text/html.

text

property – The text on the label.

wrap

property – Whether the content is allowed to be wrapped on multiple lines. Set to 0/False for no wrap, 1/True for word-wrap, 2 for character wrap.