Skip to main content

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.",
)
Alert
Alert

Inherits: LayoutControl

Properties

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)
alert

Properties​

descriptionclass-attributeinstance-attribute​

description: StrOrControl | None = None

The text shown below title.

iconclass-attributeinstance-attribute​

icon: IconDataOrControl | None = None

An icon or control shown before title and description.

icon_colorclass-attributeinstance-attribute​

icon_color: ColorValue | None = None

The color of icon.

If None, the color is taken from variant.

titleclass-attributeinstance-attribute​

title: StrOrControl | None = None

The title of this alert.

variantclass-attributeinstance-attribute​

The visual variant of this alert.