Skip to content

Placeholder

A placeholder box.

Inherits: LayoutControl

Properties

Examples#

Live example

Basic Example#

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.Placeholder(
            expand=True,
            color=ft.Colors.random(),
        )
    )


ft.run(main)

basic

Properties#

color class-attribute instance-attribute #

The color of the placeholder box.

content class-attribute instance-attribute #

content: Control | None = None

An optional Control to display inside the placeholder.

fallback_height class-attribute instance-attribute #

fallback_height: Number = 400.0

The height to use when the placeholder is in a situation with an unbounded height.

fallback_width class-attribute instance-attribute #

fallback_width: Number = 400.0

The width to use when the placeholder is in a situation with an unbounded width.

stroke_width class-attribute instance-attribute #

stroke_width: Number | None = 2.0

The width of the lines in the placeholder box.