Docs
Components/Layout/Alert

Alert

An inline alert banner with icon and variant styling.

s0 add alert

Usage

S0.Alert {
    S0.AlertTitle("Heads up!")
    S0.AlertDescription("You can add components using the CLI.")
}
S0.Alert(variant: .destructive) {
    S0.AlertTitle("Error")
    S0.AlertDescription("Something went wrong.")
}

Parameters

NameTypeDefaultDescription
variantAlertVariant.defaultStyle: .default, .destructive, .success, .warning.
content@ViewBuilder () -> ContentUse AlertTitle and AlertDescription inside.