{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} module Lucid.Alpine where import Data.Text import Lucid.Base (Attribute, makeAttribute) -- | x-data -- Declare a new Alpine component and its data for a block of HTML xData_ :: Maybe Text -> Attribute xData_ = \case Nothing -> makeAttribute "data-x-data" mempty Just object -> makeAttribute "data-x-data" object {-