Form Controls
Bulma provides a comprehensive form system with proper structure and validation states. Forms are built using a combination offield, control, and label classes.
HTML Form Elements
Bulma supports the following native HTML form elements:<form><button><input><textarea><label>
label- for form labelsinput- for text inputstextarea- for multi-line text areasselect- for dropdown selectscheckbox- for checkbox inputsradio- for radio buttonsbutton- for form buttonshelp- for help text
Complete Form Example
Form Field
Thefield container is a simple container for:
- A text
label - A form
control - An optional
helptext
Form Control
Thecontrol is a versatile block container meant to enhance single form controls. It can only contain:
inputselectbuttonicon
- Keep spacing consistent
- Combine form controls into a group
- Append and prepend icons to a form control
- Add loading states
Label Sizes
Labels support size modifiers:Help Text
Thehelp class displays helper text below form controls:
Icons in Form Controls
You can append icons to form controls using Font Awesome or other icon libraries.Icon Modifiers
Add one of these modifiers to thecontrol:
has-icons-left- for left-side iconshas-icons-right- for right-side icons (or both)
icon:
icon is-leftif usinghas-icons-lefticon is-rightif usinghas-icons-right
Icons with Different Sizes
The size of the input will define the size of the icon container:Form Addons
To attach controls together, use thehas-addons modifier on the field:
Expanded Addons
Useis-expanded to fill remaining space:
Addon Alignment
Align addons with these modifiers:has-addons-centered- center alignmenthas-addons-right- right alignmenthas-addons-fullwidth- all controls take equal space
Form Groups
Group controls together usingis-grouped on the field:
Group Alignment
is-grouped-centered- center alignmentis-grouped-right- right alignment
Expanded Groups
Addis-expanded to fill remaining space:
Multiline Groups
Addis-grouped-multiline to wrap controls across multiple lines:
Horizontal Form
Create horizontal forms usingis-horizontal modifier with field-label and field-body:
Field Label Sizes
Thefield-label comes with size modifiers for vertical alignment:
is-smallis-normalis-mediumis-large
Loading State
Add a loading spinner to a control:Disabled Forms
Disable part or all of a form using afieldset with the disabled attribute:
