--- layout: documentation doc-tab: elements doc-subtab: form --- {% include subnav-elements.html %}

Form controls

All generic form controls, designed for consistency


The following form controls classes are supported:

  • .label
  • .input
  • .textarea
  • .select
  • .checkbox
  • .radio
  • .button
  • .help

When combining several controls in a form, use the .control class as a container, to keep the spacing consistent.

{% capture form_example %}

This username is available

This email is invalid

{% endcapture %}
{{form_example}}
{% highlight html %} {{form_example}} {% endhighlight %}

Colors

{% capture colors_example %}

{% endcapture %}
{{colors_example}}
{% highlight html %} {{colors_example}} {% endhighlight %}

{% capture sizes_example %}

{% endcapture %}

Sizes

{{sizes_example}}
{% highlight html %} {{sizes_example}} {% endhighlight %}

States

Normal

{% capture normal_example %}

{% endcapture %}
{{normal_example}}
{% highlight html %} {{normal_example}} {% endhighlight %}

Hover

{% capture hover_example %}

{% endcapture %}
{{hover_example}}
{% highlight html %} {{hover_example}} {% endhighlight %}

Focus

{% capture focus_example %}

{% endcapture %}
{{focus_example}}
{% highlight html %} {{focus_example}} {% endhighlight %}

Loading

{% capture loading_example %}

{% endcapture %}
{{loading_example}}
{% highlight html %} {{loading_example}} {% endhighlight %}

Disabled

{% capture disabled_example %}

{% endcapture %}
{{disabled_example}}
{% highlight html %} {{disabled_example}} {% endhighlight %}

With Font Awesome icons

{% capture icons_example %}

{% endcapture %}
{{icons_example}}
{% highlight html %} {{icons_example}} {% endhighlight %}
{% capture icons_sizes_example %}

{% endcapture %}

New!

If the control contains an icon, Bulma will make sure the button remains centered, no matter the size of the input or of the icon.

{{icons_sizes_example}}
{% highlight html %} {{icons_sizes_example}} {% endhighlight %}
{% capture icons_sizes_right_example %}

{% endcapture %}

By appending the has-icon-right, the icon will be placed on the right side instead.

{{icons_sizes_right_example}}
{% highlight html %} {{icons_sizes_right_example}} {% endhighlight %}

Form addons

If you want to attach controls together, use the has-addons modifier on the control container:

{% capture addons_example %}

Search

{% endcapture %}
{{addons_example}}
{% highlight html %} {{addons_example}} {% endhighlight %}

You can attach inputs, buttons, and dropdowns only.

Use the is-expanded modifier on the element you want to fill up the remaing space (in this case, the input):

{% capture addons_expanded_example %}

Transfer

Transfer

{% endcapture %}
{{addons_expanded_example}}
{% highlight html %} {{addons_expanded_example}} {% endhighlight %}

Use the has-addons-centered or the has-addons-right modifers to alter the alignment.

{% capture addons_center_example %}

Transfer

{% endcapture %}
{{addons_center_example}}
{% highlight html %} {{addons_center_example}} {% endhighlight %} {% capture addons_right_example %}

Transfer

{% endcapture %}
{{addons_right_example}}
{% highlight html %} {{addons_right_example}} {% endhighlight %}

Form group

If you want to group controls together, use the is-grouped modifier on the control container:

{% capture group_example %} {% endcapture %}
{{group_example}}
{% highlight html %} {{group_example}} {% endhighlight %}

Add the is-expanded modifier on the control element you want to fill up the remaining space.


Horizontal form

If you want a horizontal form control, use the is-horizontal modifier on the control container, in which you include:

  • control-label for the side label
  • control for the input/select/textarea container

You can of course use is-grouped or has-addons for the child elements.

{% capture horizontal_form_example %}

{% endcapture %} {{horizontal_form_example}} {% highlight html %} {{horizontal_form_example}} {% endhighlight %}