Skip to main content

Card

A Fluent card: a bordered surface that groups related content.

Example:

fluent.Card(content=ft.Text("Card content"))
Card
Card

Inherits: LayoutControl

Properties

Example​

Fluent Card​

Sourceplay_arrowTry Online
import flet_fluent_ui as fluent

import flet as ft


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

page.add(
ft.SafeArea(
content=fluent.Card(
width=360,
padding=16,
content=ft.Column(
tight=True,
controls=[
ft.Text("Storage", size=18, weight=ft.FontWeight.W_600),
ft.Text("120 GB of 256 GB used"),
fluent.ProgressBar(value=47),
ft.Row(
alignment=ft.MainAxisAlignment.END,
controls=[fluent.Button("Manage storage")],
),
],
),
)
)
)


if __name__ == "__main__":
ft.run(main)
card
A storage card

Properties​

bgcolorclass-attributeinstance-attribute​

bgcolor: ColorValue | None = None

The background color.

If None, the card color of the theme is used.

border_colorclass-attributeinstance-attribute​

border_color: ColorValue | None = None

The color of the border.

If None, the theme's card stroke color is used.

border_radiusclass-attributeinstance-attribute​

border_radius: BorderRadiusValue = 4

The corner radius.

contentinstance-attribute​

content: Control

The control shown inside this card.

paddingclass-attributeinstance-attribute​

padding: PaddingValue = 12

The space between the border and content.