ButtonViewElement
A ButtonViewElement
writes a <button>
element to the output.
Element and builder
The ButtonViewElement
has an equivalent ButtonViewElementBuilder
.
A builder can be created using BootstrapViewElements.bootstrap.builders.button()
factory methods.
ButtonViewElement attributes
Attribute | Description | Default |
---|---|---|
|
A |
BUTTON |
|
A |
ACTIVE |
|
An icon can be provided to show on the button. It can be aligned left, right or set as iconOnly. |
Not set by default |
|
Transform the |
Not set by default |
Examples
Creating a simple button
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
bootstrap.builders
.button()
.text( "Click me" )
.build();
Button as link with icon
import static com.foreach.across.modules.bootstrapui.styles.BootstrapStyles.css;
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
import static com.foreach.across.modules.web.ui.elements.HtmlViewElements.html;
bootstrap.builders
.button()
.text( "To google " )
.link( "http://www.foreach.be" )
.iconRight()
.icon( IconSet.iconSet( FONT_AWESOME_SOLID_ICON_SET ).icon( "download" ) )
.build();