Skip to content
daisyBlazor

ErrorAlert

A filled error Alert that renders nothing while Message is null, so it can sit unguarded above a form and appear only when something fails.
Feedback.alert.alert-error
Cover · <ErrorAlert>

Checkout

2 × Pro seat, monthly€58.00

Examples

Basic

Pass the error text as Message. Class defaults to mb-4.

website/Examples/Feedback/ErrorAlertBasicExample.razor Source

Set Message to null and the alert disappears without an @if.

Message is null, so nothing is rendered.

website/Examples/Feedback/ErrorAlertToggleExample.razor Source

After a failed save

Catch the exception and show its message.

website/Examples/Feedback/ErrorAlertSaveExample.razor Source

Playground

<ErrorAlert
            Message="The payment provider did not respond. Try again in a minute." />

API

<ErrorAlert>

DaisyBlazor.Feedback

Filled error Alert; renders nothing when Message is null or blank.

Parameters

  • Message string
    = null

    Error text. When null, empty or whitespace, the alert is not rendered.

  • Class string
    = null

    Extra CSS classes applied to the alert. No default margin: space it from the layout (gap, Stack).

  • Style string
    = null

    Inline CSS style applied to the alert.

Something went wrong while running the docs. Reload