--- 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 icon 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 %} {{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.
Add the is-expanded modifier on the control element you want to fill up the remaining space.

{% capture group_example %}

Search

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

Horizontal form

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

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

{% capture horizontal_form_example %}

This email is correct

This field is required

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