yesod-form-bootstrap4-1.0.2: renderBootstrap4

Safe HaskellNone
LanguageHaskell2010

Yesod.Form.Bootstrap4

Description

this program based on Yesod.Form.Bootstrap3 of yesod-form yesod-form under MIT license, author is Michael Snoyman michael@snoyman.com

Synopsis

Documentation

renderBootstrap4 :: Monad m => BootstrapFormLayout -> FormRender m a Source #

Render the given form using Bootstrap v3 conventions.

data BootstrapFormLayout Source #

The layout used for the bootstrap form.

bfs :: RenderMessage site msg => msg -> FieldSettings site Source #

withAutofocus :: FieldSettings site -> FieldSettings site Source #

Add an autofocus attribute to a field.

withLargeInput :: FieldSettings site -> FieldSettings site Source #

Add the input-lg CSS class to a field.

withSmallInput :: FieldSettings site -> FieldSettings site Source #

Add the input-sm CSS class to a field.

bootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> AForm m () Source #

A Bootstrap v4 submit button disguised as a field for convenience. For example, if your form currently is:

Person <$> areq textField "Name"    Nothing
       <*> areq textField "Surname" Nothing

Then just change it to:

Person <$> areq textField "Name"    Nothing
       <*> areq textField "Surname" Nothing
       <*  bootstrapSubmit ("Register" :: BootstrapSubmit Text)

(Note that <* is not a typo.)

Alternatively, you may also just create the submit button manually as well in order to have more control over its layout.

mbootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> MForm m (FormResult (), FieldView site) Source #

Same as bootstrapSubmit but for monadic forms. This isn't as useful since you're not going to use renderBootstrap4 anyway.

data BootstrapSubmit msg Source #

How the bootstrapSubmit button should be rendered.

Constructors

BootstrapSubmit 

Fields

Instances
Eq msg => Eq (BootstrapSubmit msg) Source # 
Instance details

Defined in Yesod.Form.Bootstrap4

Ord msg => Ord (BootstrapSubmit msg) Source # 
Instance details

Defined in Yesod.Form.Bootstrap4

Read msg => Read (BootstrapSubmit msg) Source # 
Instance details

Defined in Yesod.Form.Bootstrap4

Show msg => Show (BootstrapSubmit msg) Source # 
Instance details

Defined in Yesod.Form.Bootstrap4

IsString msg => IsString (BootstrapSubmit msg) Source # 
Instance details

Defined in Yesod.Form.Bootstrap4