All generic form controls, designed for consistency
The following form controls classes are supported:
.label
.input
.textarea
.select
.checkbox
.radio
.button
.help
Each of them should be wrapped in a .control container.
When combining several controls in a form, use the .field class as a container, to keep the spacing consistent.
This username is available
This email is invalid
<divclass="field"><labelclass="label">Name</label><divclass="control"><inputclass="input"type="text"placeholder="Text input"></div></div><divclass="field"><labelclass="label">Username</label><divclass="control has-icons-left has-icons-right"><inputclass="input is-success"type="text"placeholder="Text input"value="bulma"><spanclass="icon is-small is-left"><iclass="fas fa-user"></i></span><spanclass="icon is-small is-right"><iclass="fas fa-check"></i></span></div><pclass="help is-success">This username is available</p></div><divclass="field"><labelclass="label">Email</label><divclass="control has-icons-left has-icons-right"><inputclass="input is-danger"type="email"placeholder="Email input"value="hello@"><spanclass="icon is-small is-left"><iclass="fas fa-envelope"></i></span><spanclass="icon is-small is-right"><iclass="fas fa-exclamation-triangle"></i></span></div><pclass="help is-danger">This email is invalid</p></div><divclass="field"><labelclass="label">Subject</label><divclass="control"><divclass="select"><select><option>Select dropdown</option><option>With options</option></select></div></div></div><divclass="field"><labelclass="label">Message</label><divclass="control"><textareaclass="textarea"placeholder="Textarea"></textarea></div></div><divclass="field"><divclass="control"><labelclass="checkbox"><inputtype="checkbox">
I agree to the <ahref="#">terms and conditions</a></label></div></div><divclass="field"><divclass="control"><labelclass="radio"><inputtype="radio"name="question">
Yes
</label><labelclass="radio"><inputtype="radio"name="question">
No
</label></div></div><divclass="field is-grouped"><divclass="control"><buttonclass="button is-link">Submit</button></div><divclass="control"><buttonclass="button is-text">Cancel</button></div></div>
<divclass="field"><labelclass="label">Label</label><divclass="control"><inputclass="input"type="text"placeholder="Text input"></div><pclass="help">This is a help text</p></div>
This container allows form fields to be spaced consistently.
<divclass="field"><labelclass="label">Name</label><divclass="control"><inputclass="input"type="text"placeholder="e.g Alex Smith"></div></div><divclass="field"><labelclass="label">Email</label><divclass="control"><inputclass="input"type="email"placeholder="e.g. [email protected]"></div></div>
The control is a versatile container meant to enhance single form controls. Because it has the same height as a control elements, it can only contain the following elements:
<divclass="field has-addons"><pclass="control"><spanclass="select"><select><option>$</option><option>£</option><option>€</option></select></span></p><pclass="control"><inputclass="input"type="text"placeholder="Amount of money"></p><pclass="control"><aclass="button">
Transfer
</a></p></div><divclass="field has-addons"><pclass="control"><spanclass="select"><select><option>$</option><option>£</option><option>€</option></select></span></p><pclass="control is-expanded"><inputclass="input"type="text"placeholder="Amount of money"></p><pclass="control"><aclass="button">
Transfer
</a></p></div>
If you want a full width select dropdown, pair control is-expanded with select is-fullwidth.
<divclass="field has-addons has-addons-centered"><pclass="control"><spanclass="select"><select><option>$</option><option>£</option><option>€</option></select></span></p><pclass="control"><inputclass="input"type="text"placeholder="Amount of money"></p><pclass="control"><aclass="button is-primary">
Transfer
</a></p></div>
<divclass="field has-addons has-addons-right"><pclass="control"><spanclass="select"><select><option>$</option><option>£</option><option>€</option></select></span></p><pclass="control"><inputclass="input"type="text"placeholder="Amount of money"></p><pclass="control"><aclass="button is-primary">
Transfer
</a></p></div>
<divclass="field is-grouped is-grouped-multiline"><pclass="control"><aclass="button">
One
</a></p><pclass="control"><aclass="button">
Two
</a></p><pclass="control"><aclass="button">
Three
</a></p><pclass="control"><aclass="button">
Four
</a></p><pclass="control"><aclass="button">
Five
</a></p><pclass="control"><aclass="button">
Size
</a></p><pclass="control"><aclass="button">
Seven
</a></p><pclass="control"><aclass="button">
Eight
</a></p><pclass="control"><aclass="button">
Nine
</a></p><pclass="control"><aclass="button">
Ten
</a></p><pclass="control"><aclass="button">
Eleven
</a></p><pclass="control"><aclass="button">
Twelve
</a></p><pclass="control"><aclass="button">
Thirteen
</a></p></div>
List of buttons
If you only need a list of buttons, try out the new buttons class with which you can create a multiline list of buttons.
<divclass="field is-horizontal"><divclass="field-label is-normal"><labelclass="label">From</label></div><divclass="field-body"><divclass="field"><pclass="control is-expanded has-icons-left"><inputclass="input"type="text"placeholder="Name"><spanclass="icon is-small is-left"><iclass="fas fa-user"></i></span></p></div><divclass="field"><pclass="control is-expanded has-icons-left has-icons-right"><inputclass="input is-success"type="email"placeholder="Email"value="[email protected]"><spanclass="icon is-small is-left"><iclass="fas fa-envelope"></i></span><spanclass="icon is-small is-right"><iclass="fas fa-check"></i></span></p></div></div></div><divclass="field is-horizontal"><divclass="field-label"></div><divclass="field-body"><divclass="field is-expanded"><divclass="field has-addons"><pclass="control"><aclass="button is-static">
+44
</a></p><pclass="control is-expanded"><inputclass="input"type="tel"placeholder="Your phone number"></p></div><pclass="help">Do not enter the first zero</p></div></div></div><divclass="field is-horizontal"><divclass="field-label is-normal"><labelclass="label">Department</label></div><divclass="field-body"><divclass="field is-narrow"><divclass="control"><divclass="select is-fullwidth"><select><option>Business development</option><option>Marketing</option><option>Sales</option></select></div></div></div></div></div><divclass="field is-horizontal"><divclass="field-label"><labelclass="label">Already a member?</label></div><divclass="field-body"><divclass="field is-narrow"><divclass="control"><labelclass="radio"><inputtype="radio"name="member">
Yes
</label><labelclass="radio"><inputtype="radio"name="member">
No
</label></div></div></div></div><divclass="field is-horizontal"><divclass="field-label is-normal"><labelclass="label">Subject</label></div><divclass="field-body"><divclass="field"><divclass="control"><inputclass="input is-danger"type="text"placeholder="e.g. Partnership opportunity"></div><pclass="help is-danger">
This field is required
</p></div></div></div><divclass="field is-horizontal"><divclass="field-label is-normal"><labelclass="label">Question</label></div><divclass="field-body"><divclass="field"><divclass="control"><textareaclass="textarea"placeholder="Explain how we can help you"></textarea></div></div></div></div><divclass="field is-horizontal"><divclass="field-label"><!-- Left empty for spacing --></div><divclass="field-body"><divclass="field"><divclass="control"><buttonclass="button is-primary">
Send message
</button></div></div></div></div>
To preserve the vertical alignment of labels with each type and size of control, the .field-label comes with 4 size modifiers:
Form elements can be customized using the following generic variables. Simply set one or multiple of these variables before importing Bulma. Learn how.