Alert DaisyUI

Feedback banners using DaisyUI's alert class.

Variants

go
@daisyui.Alert(daisyui.AlertProps{Variant: daisyui.AlertInfo}) {
    <span>Info — something you should know.</span>
}
@daisyui.Alert(daisyui.AlertProps{Variant: daisyui.AlertSuccess}) {
    <span>Success — action completed.</span>
}
@daisyui.Alert(daisyui.AlertProps{Variant: daisyui.AlertWarning}) {
    <span>Warning — proceed with care.</span>
}
@daisyui.Alert(daisyui.AlertProps{Variant: daisyui.AlertError}) {
    <span>Error — something went wrong.</span>
}

With icon

go
@daisyui.Alert(daisyui.AlertProps{Variant: daisyui.AlertSuccess}) {
    <svg class="h-5 w-5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
        <path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
    </svg>
    <span>Your profile has been saved.</span>
}

Props

PropTypeDefaultDescription
Variant AlertVariant""alert-info, alert-success, alert-warning, alert-error
Class string""Extra classes
Attrs templ.AttributesnilSpread any HTML attribute