BSD-3-Clause licensed by Daniel Campoverde
Maintained by [email protected]
This version can be pinned in stack with:yesod-alerts-0.1.3.0@sha256:8fae26103acfb816d3aacfb25f9b7c90245a662bd74585a13d31fa1aca31822a,1271

yesod-alerts

Alert messages for the Yesod framework

Setup

Modify your definition of defaultLayout in Foundation.hs:

defaultLayout widget = do
    ...
    alerts  <- getAlerts
    ...

Then Include a renderer in default-layout.hamlet

...
#{renderAlertsBootstrap3 alerts}
...
^{widget}
...

Usage

Set alerts from your handlers

getHomeR :: Handler Html
getHomeR = do
    ...
    setAlert (Alert Error "oops")
    setSuccessAlert "Yay!"
    ...
    defautlLayout $ do
        $(widgetFile "homepage")

Renderers

  • Bootstrap v3
  • Bootstrap v4
  • Foundation v5