Alert
A Shadcn alert that calls attention to a short message.
Example:
shad.Alert(
icon=shad.LucideIcons.TERMINAL,
title="Heads up!",
description="You can add components to your app using the CLI.",
)

Inherits: LayoutControl
Properties
description- The text shown belowtitle.icon- An icon or control shown beforetitleanddescription.icon_color- The color oficon.title- The title of this alert.variant- The visual variant of this alert.
Example
Shadcn Alert
play_arrowTry Online
import flet_shadcn_ui as shad
import flet as ft
def main(page: ft.Page):
page.title = "Shadcn Alert"
page.add(
ft.SafeArea(
content=ft.Column(
width=420,
controls=[
shad.Alert(
icon=shad.LucideIcons.TERMINAL,
title="Heads up!",
description=(
"You can add components to your app using the CLI."
),
),
shad.Alert(
icon=shad.LucideIcons.CIRCLE_ALERT,
title="Error",
description="Your session has expired. Please log in again.",
variant=shad.AlertVariant.DESTRUCTIVE,
),
],
)
)
)
if __name__ == "__main__":
ft.run(main)

Properties
descriptionclass-attributeinstance-attribute
description: StrOrControl | None = NoneThe text shown below title.
iconclass-attributeinstance-attribute
icon: IconDataOrControl | None = NoneAn icon or control shown before title and description.
icon_colorclass-attributeinstance-attribute
icon_color: ColorValue | None = NoneThe color of icon.
If None, the color is taken from variant.
variantclass-attributeinstance-attribute
variant: AlertVariant = AlertVariant.PRIMARYThe visual variant of this alert.