This project provides Bootstrap 3 compatible HTML form widgets for Play Framework. The form widgets provided with Play Framework feature a minimum of parameters and have an arcane syntax as a result. Those widgets are rendered within a <dl/> tags, which is only useful for a narrow range of scenarios. Most HTML5 features are not supported "out of the box" so it is common to spend a lot of time crafting wrappers around the standard widgets.
The Play Bootstrap widgets require Twitter Bootstrap, but otherwise its API is similar to the Play Framework form widget API.
ScalaTags is another library for generating HTML using Scala. It is not Play Framework aware, or Twitter Bootstrap aware – instead, it is completely generic.
This package produces output that closely resembles Play Bootstrap's output,
but it uses many explicit parameters instead of following the Play Framework API.
Widgets in the views.html.htmlForm
package are HTML5 compatible,
and include a CSRF form helper.
Widgets related to Twitter Bootstrap 3.x are provided in the views.html.htmlForm.bootstrap3
package.
Two flavors of modal dialog are provided, smart tabs and a date picker.
The HtmlForm
object contains checkbox
es, select
s, and various flavors of input
for
email, URLs, currency, passwords, percentages, range-limited numeric values and much more.
Add this to your project's build.sbt
:
resolvers += "micronautics/play on bintray" at "https://dl.bintray.com/micronautics/play"
libraryDependencies += "com.micronautics" %% "html-form-scala" % "0.2.1" withSources()
This project requires an implementation of model.persistence.Id
, defined in
has-id for testing purposes.
Other projects that incorporate this project as a dependency must define their own implementation
of model.persistence.Id
(for persistence, for example).