Skip to main content

InfoLabel

A Fluent label for a field: a short text shown above (or after) another control, such as a TextBox.

Example:

fluent.InfoLabel(
label="Email",
content=fluent.TextBox(placeholder="name@example.com"),
)
InfoLabel
InfoLabel

Inherits: LayoutControl

Properties

Example​

Fluent InfoLabel​

Sourceplay_arrowTry Online
import flet_fluent_ui as fluent

import flet as ft


def main(page: ft.Page):
page.title = "Fluent InfoLabel"

page.add(
ft.SafeArea(
content=ft.Column(
width=320,
spacing=16,
controls=[
fluent.InfoLabel(
label="Full name",
content=fluent.TextBox(placeholder="Jane Doe"),
),
fluent.InfoLabel(
label="Email",
content=fluent.TextBox(placeholder="jane@example.com"),
),
fluent.InfoLabel(
label="Subscribe to the newsletter",
horizontal=True,
content=fluent.ToggleSwitch(value=True),
),
],
)
)
)


if __name__ == "__main__":
ft.run(main)
info_label
Labelled sign-up fields

Properties​

contentclass-attributeinstance-attribute​

content: Control | None = None

The control the label is for.

horizontalclass-attributeinstance-attribute​

horizontal: bool = False

Whether label is shown after content, on the same line, instead of above it. Use it for controls such as a ToggleSwitch without a label of their own.

labelinstance-attribute​

label: str

The text of the label.