Skip to content

VerticalDivider

A thin vertical line, with padding on either side.

In the material design language, this represents a divider.

Inherits: Control

Properties

Examples#

Live example

Basic Example#

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.Row(
            expand=True,
            spacing=0,
            controls=[
                ft.Container(
                    bgcolor=ft.Colors.ORANGE_300,
                    alignment=ft.Alignment.CENTER,
                    expand=True,
                ),
                ft.VerticalDivider(),
                ft.Container(
                    bgcolor=ft.Colors.BROWN_400,
                    alignment=ft.Alignment.CENTER,
                    expand=True,
                ),
                ft.VerticalDivider(width=1, color=ft.Colors.WHITE),
                ft.Container(
                    bgcolor=ft.Colors.BLUE_300,
                    alignment=ft.Alignment.CENTER,
                    expand=True,
                ),
                ft.VerticalDivider(width=9, thickness=3),
                ft.Container(
                    bgcolor=ft.Colors.GREEN_300,
                    alignment=ft.Alignment.CENTER,
                    expand=True,
                ),
            ],
        )
    )


ft.run(main)

basic

Properties#

color #

color: ColorValue | None = None

The color to use when painting the line.

If None, DividerTheme.color is used.

leading_indent #

leading_indent: Number | None = None

The amount of empty space to the leading edge of the divider.

If None, DividerTheme.leading_indent is used. If that's is also None, defaults to 0.0.

Raises:

radius #

radius: BorderRadiusValue | None = None

The border radius of the divider.

thickness #

thickness: Number | None = None

The thickness of this divider.

Note

A divider with a thickness of 0.0 is always drawn as a line with a width of exactly one device pixel.

If None, DividerTheme.thickness is used. If that's is also None, defaults to 0.0.

Raises:

trailing_indent #

trailing_indent: Number | None = None

The amount of empty space to the trailing edge of the divider.

If None, DividerTheme.trailing_indent is used. If that's is also None, defaults to 0.0.

Raises:

width #

width: Number | None = None

The divider's width. The divider itself is always drawn as a vertical line that is centered within the width specified by this value.

If None, DividerTheme.space is used. If that's is also None, defaults to 16.0.

Raises: