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 #

The color of the placeholder box.

content #

content: Control | None = None

An optional Control to display inside the placeholder.

fallback_height #

fallback_height: Number = 400.0

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

fallback_width #

fallback_width: Number = 400.0

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

stroke_width #

stroke_width: Number | None = 2.0

The width of the lines in the placeholder box.