--- title: Input layout: docs theme: library doc-tab: form doc-subtab: input breadcrumb: - home - documentation - form - form-input variables_keys: - $input-color - $input-background-color - $input-border-color - $input-shadow - $input-hover-color - $input-hover-border-color - $input-focus-color - $input-focus-border-color - $input-focus-box-shadow-size - $input-focus-box-shadow-color - $input-disabled-color - $input-disabled-background-color - $input-disabled-border-color - $input-arrow - $input-icon-color - $input-icon-active-color - $input-radius meta: colors: true sizes: true variables: true --- {% capture input_example %} {% endcapture %} {% capture rounded_example %} {% endcapture %} {% capture normal_example %}
{% endcapture %} {% capture hover_example %}
{% endcapture %} {% capture focus_example %}
{% endcapture %} {% capture loading_example %}
{% endcapture %} {% capture loading_sizes_example %}
{% endcapture %} {% capture disabled_example %}
{% endcapture %} {% capture readonly_example %}
{% endcapture %} {% capture static_example %}

{% endcapture %} {% capture icons_example %}

{% endcapture %} {% capture has_icons_small_example %}
{% endcapture %} {% capture has_icons_normal_example %}
{% endcapture %} {% capture has_icons_medium_example %}
{% endcapture %} {% capture has_icons_large_example %}
{% endcapture %}

The Bulma input CSS class is meant for <input> HTML elements. The following type attributes are supported:

Several modifiers are supported which affect:

{{ input_example }}
{% highlight html -%} {{- input_example -}} {%- endhighlight %}
{% include docs/elements/anchor.html name="Colors" %} {% for color in site.data.colors.justColors %} {% capture foobar %} {% endcapture %} {% include docs/elements/snippet.html content=foobar %} {% endfor %} {% include docs/elements/anchor.html name="Sizes" %} {% for size in site.data.sizes %} {% capture foobar %} {% endcapture %} {% include docs/elements/snippet.html content=foobar %} {% endfor %} {% include docs/elements/anchor.html name="Styles" %}
{{ rounded_example }}
{% highlight html -%} {{- rounded_example -}} {%- endhighlight %}
{% include docs/elements/anchor.html name="States" %}

Normal

{{ normal_example }}
{% highlight html -%} {{- normal_example -}} {%- endhighlight %}

Hover

{{ hover_example }}
{% highlight html -%} {{- hover_example -}} {%- endhighlight %}

Focus

{{ focus_example }}
{% highlight html -%} {{- focus_example -}} {%- endhighlight %}

Loading

{{ loading_example }}
{% highlight html -%} {{- loading_example -}} {%- endhighlight %}

You can resize the loading spinner by appending is-small, is-medium or is-large to the control container.

{{ loading_sizes_example }}
{% highlight html -%} {{- loading_sizes_example -}} {%- endhighlight %}

Disabled

{{ disabled_example }}
{% highlight html -%} {{- disabled_example -}} {%- endhighlight %}

Readonly and static inputs

If you use the readonly HTML attribute, the input will look similar to a normal one, but is not editable and has no shadow.

{{ readonly_example }}
{% highlight html -%} {{- readonly_example -}} {%- endhighlight %}

If you also append the is-static modifier, it removes the background, border, shadow, and horizontal padding, while maintaining the vertical spacing so you can easily align the input in any context, like a horizontal form.

{{ static_example }}
{% highlight html -%} {{- static_example -}} {%- endhighlight %} {% include docs/elements/anchor.html name="With Font Awesome icons" %}

You can append one of 2 modifiers on a control:

You also need to add a modifier on the icon:

The size of the input will define the size of the icon container.

{{ icons_example }}
{% highlight html -%} {{- icons_example -}} {%- endhighlight %}

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.

{{ has_icons_small_example }}
{% highlight html -%} {{- has_icons_small_example -}} {%- endhighlight %}
{{ has_icons_normal_example }}
{% highlight html -%} {{- has_icons_normal_example -}} {%- endhighlight %}
{{ has_icons_medium_example }}
{% highlight html -%} {{- has_icons_medium_example -}} {%- endhighlight %}
{{ has_icons_large_example }}
{% highlight html -%} {{- has_icons_large_example -}} {%- endhighlight %}