Safe Haskell | None |
---|---|
Language | Haskell2010 |
Yesod.Form.Bootstrap4
Description
this program based on Yesod.Form.Bootstrap3 of yesod-form yesod-form under MIT license, author is Michael Snoyman [email protected]
- renderBootstrap4 :: Monad m => BootstrapFormLayout -> FormRender m a
- data BootstrapFormLayout
- data BootstrapGridOptions
- bfs :: RenderMessage site msg => msg -> FieldSettings site
- withPlaceholder :: Text -> FieldSettings site -> FieldSettings site
- withAutofocus :: FieldSettings site -> FieldSettings site
- withLargeInput :: FieldSettings site -> FieldSettings site
- withSmallInput :: FieldSettings site -> FieldSettings site
- bootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> AForm m ()
- mbootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> MForm m (FormResult (), FieldView site)
- data BootstrapSubmit msg = BootstrapSubmit {}
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.
data BootstrapGridOptions Source #
bfs :: RenderMessage site msg => msg -> FieldSettings site Source #
withPlaceholder :: Text -> FieldSettings site -> 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 | |
Instances
Eq msg => Eq (BootstrapSubmit msg) Source # | |
Ord msg => Ord (BootstrapSubmit msg) Source # | |
Read msg => Read (BootstrapSubmit msg) Source # | |
Show msg => Show (BootstrapSubmit msg) Source # | |
IsString msg => IsString (BootstrapSubmit msg) Source # | |