bulma/docs/documentation/form/general.html

1111 lines
28 KiB
HTML
Raw Normal View History

2017-07-17 14:05:39 +00:00
---
2017-07-29 12:02:00 +00:00
title: Form controls
2024-03-21 16:11:54 +00:00
layout: docs
theme: library
2017-07-17 14:05:39 +00:00
doc-tab: form
doc-subtab: general
2018-04-09 15:15:58 +00:00
breadcrumb:
- home
- documentation
- form
- form-general
2018-06-19 12:33:54 +00:00
variables_control_keys:
- $control-radius
- $control-radius-small
- $control-padding-vertical
- $control-padding-horizontal
variables_keys:
- $label-color
- $label-weight
- $help-size
2017-07-17 14:05:39 +00:00
---
{% capture example %}
<div class="field">
<label class="label">Name</label>
2017-07-17 14:51:22 +00:00
<div class="control">
2017-07-17 14:05:39 +00:00
<input class="input" type="text" placeholder="Text input">
2017-07-17 14:51:22 +00:00
</div>
2017-07-17 14:05:39 +00:00
</div>
<div class="field">
<label class="label">Username</label>
<div class="control has-icons-left has-icons-right">
<input class="input is-success" type="text" placeholder="Text input" value="bulma">
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-user"></i>
2017-07-17 14:05:39 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check"></i>
2017-07-17 14:05:39 +00:00
</span>
</div>
<p class="help is-success">This username is available</p>
</div>
<div class="field">
<label class="label">Email</label>
<div class="control has-icons-left has-icons-right">
2017-08-28 08:31:52 +00:00
<input class="input is-danger" type="email" placeholder="Email input" value="hello@">
2017-07-17 14:05:39 +00:00
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope"></i>
2017-07-17 14:05:39 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-exclamation-triangle"></i>
2017-07-17 14:05:39 +00:00
</span>
</div>
<p class="help is-danger">This email is invalid</p>
</div>
<div class="field">
<label class="label">Subject</label>
<div class="control">
2017-07-17 18:17:57 +00:00
<div class="select">
2017-07-17 14:05:39 +00:00
<select>
<option>Select dropdown</option>
<option>With options</option>
</select>
2017-07-17 18:17:57 +00:00
</div>
2017-07-17 14:05:39 +00:00
</div>
</div>
<div class="field">
<label class="label">Message</label>
<div class="control">
<textarea class="textarea" placeholder="Textarea"></textarea>
</div>
</div>
<div class="field">
<div class="control">
<label class="checkbox">
<input type="checkbox">
I agree to the <a href="#">terms and conditions</a>
</label>
</div>
</div>
<div class="field">
<div class="control">
<label class="radio">
<input type="radio" name="question">
Yes
</label>
<label class="radio">
<input type="radio" name="question">
No
</label>
</div>
</div>
<div class="field is-grouped">
<div class="control">
2017-10-09 17:13:02 +00:00
<button class="button is-link">Submit</button>
2017-07-17 14:05:39 +00:00
</div>
<div class="control">
<button class="button is-link is-light">Cancel</button>
2017-07-17 14:05:39 +00:00
</div>
</div>
{% endcapture %}
2019-10-13 19:06:56 +00:00
{% capture control_example %}
<div class="control">
<input class="input" type="text" placeholder="Text input">
</div>
{% endcapture %}
2017-07-17 14:05:39 +00:00
{% capture field_example %}
<div class="field">
<label class="label">Label</label>
<div class="control">
<input class="input" type="text" placeholder="Text input">
</div>
<p class="help">This is a help text</p>
</div>
{% endcapture %}
{% capture fields_example %}
<div class="field">
<label class="label">Name</label>
<div class="control">
<input class="input" type="text" placeholder="e.g Alex Smith">
</div>
</div>
<div class="field">
<label class="label">Email</label>
<div class="control">
<input class="input" type="email" placeholder="e.g. alexsmith@gmail.com">
</div>
</div>
{% endcapture %}
{% capture control_input_example %}
<div class="control">
<input class="input" type="text" placeholder="Text input">
</div>
{% endcapture %}
{% capture control_select_example %}
<div class="control">
<div class="select">
<select>
<option>Select dropdown</option>
<option>With options</option>
</select>
</div>
</div>
{% endcapture %}
{% capture control_button_example %}
<div class="control">
<button class="button is-primary">Submit</button>
</div>
{% endcapture %}
2017-07-17 14:51:22 +00:00
{% capture icons_example %}
<div class="field">
<p class="control has-icons-left has-icons-right">
<input class="input" type="email" placeholder="Email">
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check"></i>
2017-07-17 14:51:22 +00:00
</span>
</p>
</div>
<div class="field">
<p class="control has-icons-left">
<input class="input" type="password" placeholder="Password">
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-lock"></i>
2017-07-17 14:51:22 +00:00
</span>
</p>
</div>
<div class="field">
<p class="control">
<button class="button is-success">
Login
</button>
</p>
</div>
{% endcapture %}
{% capture select_icons_example %}
<div class="field">
<p class="control has-icons-left">
<span class="select">
<select>
<option selected>Country</option>
<option>Select dropdown</option>
<option>With options</option>
</select>
</span>
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-globe"></i>
2017-07-17 14:51:22 +00:00
</span>
</p>
</div>
{% endcapture %}
{% capture has_icons_small_example %}
<div class="field">
<label class="label is-small">Small input</label>
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-small" type="email" placeholder="Normal">
2017-07-17 14:51:22 +00:00
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
{% endcapture %}
{% capture has_icons_normal_example %}
<div class="field">
<label class="label">Normal input</label>
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input" type="email" placeholder="Extra small">
2017-07-17 14:51:22 +00:00
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope fa-xs"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check fa-xs"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
<div class="field">
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input" type="email" placeholder="Normal">
2017-07-17 14:51:22 +00:00
<span class="icon is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
{% endcapture %}
{% capture has_icons_medium_example %}
<div class="field">
<label class="label is-medium">Medium input</label>
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-medium" type="email" placeholder="Extra small">
2017-07-17 14:51:22 +00:00
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope fa-xs"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check fa-xs"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
<div class="field">
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-medium" type="email" placeholder="Small">
2017-07-17 14:51:22 +00:00
<span class="icon is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope fa-sm"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check fa-sm"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
<div class="field">
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-medium" type="email" placeholder="Normal">
2017-07-17 14:51:22 +00:00
<span class="icon is-medium is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-medium is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
{% endcapture %}
{% capture has_icons_large_example %}
<div class="field">
<label class="label is-large">Large input</label>
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-large" type="email" placeholder="Extra small">
2017-07-17 14:51:22 +00:00
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope fa-xs"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check fa-xs"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
<div class="field">
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-large" type="email" placeholder="Small">
2017-07-17 14:51:22 +00:00
<span class="icon is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope fa-sm"></i>
2017-07-17 14:51:22 +00:00
</span>
<span class="icon is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check fa-sm"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
<div class="field">
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-large" type="email" placeholder="Normal">
<span class="icon is-large is-left">
<i class="fas fa-envelope"></i>
2017-07-17 14:51:22 +00:00
</span>
2018-01-10 16:30:23 +00:00
<span class="icon is-large is-right">
<i class="fas fa-check"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
<div class="field">
<div class="control has-icons-left has-icons-right">
2018-01-10 16:30:23 +00:00
<input class="input is-large" type="email" placeholder="Large">
<span class="icon is-medium is-left">
<i class="fas fa-envelope fa-lg"></i>
2017-07-17 14:51:22 +00:00
</span>
2018-01-10 16:30:23 +00:00
<span class="icon is-medium is-right">
<i class="fas fa-check fa-lg"></i>
2017-07-17 14:51:22 +00:00
</span>
</div>
</div>
{% endcapture %}
2017-07-17 14:05:39 +00:00
{% capture addons_example %}
<div class="field has-addons">
2017-07-17 14:51:22 +00:00
<div class="control">
2017-07-17 14:05:39 +00:00
<input class="input" type="text" placeholder="Find a repository">
2017-07-17 14:51:22 +00:00
</div>
<div class="control">
2024-03-21 16:11:54 +00:00
<button class="button is-info">
2017-07-17 14:05:39 +00:00
Search
2024-03-21 16:11:54 +00:00
</button>
2017-07-17 14:51:22 +00:00
</div>
2017-07-17 14:05:39 +00:00
</div>
{% endcapture %}
{% capture addons_static_example %}
<div class="field has-addons">
<p class="control">
<input class="input" type="text" placeholder="Your email">
</p>
<p class="control">
<a class="button is-static">
@gmail.com
</a>
</p>
</div>
{% endcapture %}
{% capture addons_expanded_example %}
<div class="field has-addons">
<p class="control">
<span class="select">
<select>
<option>$</option>
<option>£</option>
<option></option>
</select>
</span>
</p>
<p class="control">
<input class="input" type="text" placeholder="Amount of money">
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-17 14:05:39 +00:00
Transfer
2024-03-21 16:11:54 +00:00
</button>
2017-07-17 14:05:39 +00:00
</p>
</div>
<div class="field has-addons">
<p class="control">
<span class="select">
<select>
<option>$</option>
<option>£</option>
<option></option>
</select>
</span>
</p>
<p class="control is-expanded">
<input class="input" type="text" placeholder="Amount of money">
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-17 14:05:39 +00:00
Transfer
2024-03-21 16:11:54 +00:00
</button>
2017-07-17 14:05:39 +00:00
</p>
</div>
{% endcapture %}
{% capture addons_expanded_fullwidth_example %}
<div class="field has-addons">
2017-07-17 14:51:22 +00:00
<div class="control is-expanded">
<div class="select is-fullwidth">
2017-07-17 14:05:39 +00:00
<select name="country">
<option value="Argentina">Argentina</option>
<option value="Bolivia">Bolivia</option>
<option value="Brazil">Brazil</option>
<option value="Chile">Chile</option>
<option value="Colombia">Colombia</option>
<option value="Ecuador">Ecuador</option>
<option value="Guyana">Guyana</option>
<option value="Paraguay">Paraguay</option>
<option value="Peru">Peru</option>
<option value="Suriname">Suriname</option>
<option value="Uruguay">Uruguay</option>
<option value="Venezuela">Venezuela</option>
</select>
2017-07-17 14:51:22 +00:00
</div>
</div>
<div class="control">
2017-07-17 14:05:39 +00:00
<button type="submit" class="button is-primary">Choose</button>
2017-07-17 14:51:22 +00:00
</div>
2017-07-17 14:05:39 +00:00
</div>
{% endcapture %}
{% capture addons_center_example %}
<div class="field has-addons has-addons-centered">
<p class="control">
<span class="select">
<select>
<option>$</option>
<option>£</option>
<option></option>
</select>
</span>
</p>
<p class="control">
<input class="input" type="text" placeholder="Amount of money">
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button is-primary">
2017-07-17 14:05:39 +00:00
Transfer
2024-03-21 16:11:54 +00:00
</button>
2017-07-17 14:05:39 +00:00
</p>
</div>
{% endcapture %}
{% capture addons_right_example %}
<div class="field has-addons has-addons-right">
<p class="control">
<span class="select">
<select>
<option>$</option>
<option>£</option>
<option></option>
</select>
</span>
</p>
<p class="control">
<input class="input" type="text" placeholder="Amount of money">
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button is-primary">
2017-07-17 14:05:39 +00:00
Transfer
2024-03-21 16:11:54 +00:00
</button>
2017-07-17 14:05:39 +00:00
</p>
</div>
{% endcapture %}
{% capture group_example %}
2017-07-24 18:45:21 +00:00
<div class="field is-grouped">
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button is-primary">
2017-07-24 18:45:21 +00:00
Submit
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
<a class="button is-light">
Cancel
</a>
</p>
</div>
{% endcapture %}
{% capture group_centered_example %}
<div class="field is-grouped is-grouped-centered">
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button is-primary">
2017-07-24 18:45:21 +00:00
Submit
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
<a class="button is-light">
Cancel
</a>
</p>
</div>
{% endcapture %}
{% capture group_right_example %}
<div class="field is-grouped is-grouped-right">
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button is-primary">
2017-07-24 18:45:21 +00:00
Submit
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
<a class="button is-light">
Cancel
</a>
</p>
</div>
{% endcapture %}
{% capture group_expanded_example %}
2017-07-17 14:05:39 +00:00
<div class="field is-grouped">
<p class="control is-expanded">
<input class="input" type="text" placeholder="Find a repository">
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button is-info">
2017-07-17 14:05:39 +00:00
Search
2024-03-21 16:11:54 +00:00
</button>
2017-07-17 14:05:39 +00:00
</p>
</div>
{% endcapture %}
2017-07-24 18:45:21 +00:00
{% capture group_multiline_example %}
<div class="field is-grouped is-grouped-multiline">
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
One
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Two
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Three
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Four
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Five
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
Six
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Seven
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Eight
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Nine
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Ten
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Eleven
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Twelve
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">
2017-07-24 18:45:21 +00:00
Thirteen
2024-03-21 16:11:54 +00:00
</button>
2017-07-24 18:45:21 +00:00
</p>
</div>
{% endcapture %}
2017-07-17 14:05:39 +00:00
{% capture horizontal_form_example %}
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">From</label>
</div>
<div class="field-body">
<div class="field">
<p class="control is-expanded has-icons-left">
<input class="input" type="text" placeholder="Name">
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-user"></i>
2017-07-17 14:05:39 +00:00
</span>
</p>
</div>
<div class="field">
<p class="control is-expanded has-icons-left has-icons-right">
<input class="input is-success" type="email" placeholder="Email" value="alex@smith.com">
<span class="icon is-small is-left">
2018-01-10 16:30:23 +00:00
<i class="fas fa-envelope"></i>
2017-07-17 14:05:39 +00:00
</span>
<span class="icon is-small is-right">
2018-01-10 16:30:23 +00:00
<i class="fas fa-check"></i>
2017-07-17 14:05:39 +00:00
</span>
</p>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label"></div>
<div class="field-body">
<div class="field is-expanded">
<div class="field has-addons">
<p class="control">
<a class="button is-static">
+44
</a>
</p>
<p class="control is-expanded">
<input class="input" type="tel" placeholder="Your phone number">
</p>
</div>
<p class="help">Do not enter the first zero</p>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Department</label>
</div>
<div class="field-body">
<div class="field is-narrow">
<div class="control">
<div class="select is-fullwidth">
<select>
<option>Business development</option>
<option>Marketing</option>
<option>Sales</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Already a member?</label>
</div>
<div class="field-body">
<div class="field is-narrow">
<div class="control">
<label class="radio">
<input type="radio" name="member">
Yes
</label>
<label class="radio">
<input type="radio" name="member">
No
</label>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Subject</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<input class="input is-danger" type="text" placeholder="e.g. Partnership opportunity">
</div>
<p class="help is-danger">
This field is required
</p>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Question</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<textarea class="textarea" placeholder="Explain how we can help you"></textarea>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label">
<!-- Left empty for spacing -->
</div>
<div class="field-body">
<div class="field">
<div class="control">
<button class="button is-primary">
Send message
</button>
</div>
</div>
</div>
</div>
{% endcapture %}
{% capture field_label_example %}
<div class="field is-horizontal">
<div class="field-label">
<label class="label">No padding</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<label class="checkbox">
<input type="checkbox">
Checkbox
</label>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-small">
<label class="label">Small padding</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<input class="input is-small" type="text" placeholder="Small sized input">
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Normal label</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<input class="input" type="text" placeholder="Normal sized input">
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-medium">
<label class="label">Medium label</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<input class="input is-medium" type="text" placeholder="Medium sized input">
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-large">
<label class="label">Large label</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<input class="input is-large" type="text" placeholder="Large sized input">
</div>
</div>
</div>
</div>
{% endcapture %}
2018-10-31 18:48:13 +00:00
{% capture disabled_fields_example %}
<fieldset disabled>
{{ fields_example }}
</fieldset>
{% endcapture %}
2018-04-09 15:15:58 +00:00
<div class="content">
2019-10-13 19:06:56 +00:00
<p>
2024-03-21 16:11:54 +00:00
Bulma supports the following native <strong>HTML form elements</strong>: <code>&lt;form&gt;</code>
<code>&lt;button&gt;</code> <code>&lt;input&gt;</code> <code>&lt;textarea&gt;</code> and <code>&lt;label&gt;</code>.
2019-10-13 19:06:56 +00:00
</p>
2024-03-21 16:11:54 +00:00
<p>The following CSS <strong>classes</strong> are supported:</p>
2018-04-09 15:15:58 +00:00
<ul>
2019-10-13 19:06:56 +00:00
<li><code>label</code></li>
<li><code>input</code></li>
<li><code>textarea</code></li>
<li><code>select</code></li>
<li><code>checkbox</code></li>
<li><code>radio</code></li>
<li><code>button</code></li>
<li><code>help</code></li>
2018-04-09 15:15:58 +00:00
</ul>
</div>
2017-07-17 14:05:39 +00:00
2019-10-13 19:06:56 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
To maintain an evenly balanced design, Bulma provides a very useful <code>control</code> container with which you
can <strong>wrap</strong> the form controls.
2019-10-13 19:06:56 +00:00
<br>
2024-03-21 16:11:54 +00:00
When combining several controls in a <strong>form</strong>, use the <code>field</code> class as a
<strong>container</strong>, to keep the spacing consistent.
2019-10-13 19:06:56 +00:00
</p>
</div>
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Complete form example" %}
2019-10-13 19:06:56 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=example more=true %}
2017-07-17 14:05:39 +00:00
2019-10-13 19:06:56 +00:00
<div class="content">
<p>
For the best results using Bulma, it's recommended to use the <code>control</code> element as often as possible.
</p>
</div>
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Form field" %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
<p>The <code>field</code> container is a simple container for:</p>
<ul>
<li>a text <code>label</code></li>
<li>a form <code>control</code></li>
<li>an optional <code>help</code>text</li>
</ul>
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=field_example %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
<p>This container allows form fields to be <strong>spaced consistently</strong>.</p>
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=fields_example %}
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Form control" %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2019-10-14 01:00:52 +00:00
<p>
2024-03-21 16:11:54 +00:00
The Bulma <code>control</code> is a versatile <strong>block</strong> container meant to
<strong>enhance single form controls</strong>. Because it has the same height as the element that it wraps, it can
<strong class="has-text-danger">only contain</strong> the following Bulma elements:
2019-10-14 01:00:52 +00:00
</p>
2018-04-09 15:15:58 +00:00
<ul>
<li><code>input</code></li>
<li><code>select</code></li>
<li><code>button</code></li>
<li><code>icon</code></li>
</ul>
2024-03-21 16:11:54 +00:00
<p>This container gives the ability to:</p>
2019-10-14 01:00:52 +00:00
<ul>
2024-03-21 16:11:54 +00:00
<li>keep the <strong>spacing</strong> consistent</li>
<li>combine form controls into a <strong>group</strong></li>
<li>combine form controls into a <strong>list</strong></li>
<li>append and prepend <strong>icons</strong> to a form control</li>
2019-10-14 01:00:52 +00:00
</ul>
2018-04-09 15:15:58 +00:00
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=control_input_example %}
2018-04-09 15:15:58 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=control_select_example %}
2018-04-09 15:15:58 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=control_button_example %}
2018-04-09 15:15:58 +00:00
<!-- Font Awesome Icons -->
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="With icons" %}
2018-04-09 15:15:58 +00:00
<div class="content">
<p>You can append one of 2 <strong>modifiers</strong> on a control:</p>
<ul>
<li>
<code>has-icons-left</code>
</li>
2024-03-21 16:11:54 +00:00
<li>and/or <code>has-icons-right</code></li>
2018-04-09 15:15:58 +00:00
</ul>
<p>You also need to add a modifier on the <strong>icon</strong>:</p>
<ul>
2024-03-21 16:11:54 +00:00
<li><code>icon is-left</code> if <code>has-icons-left</code> is used</li>
<li><code>icon is-right</code> if <code>has-icons-right</code> is used</li>
2018-04-09 15:15:58 +00:00
</ul>
<p>The size of the <strong>input</strong> will define the size of the icon container.</p>
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=icons_example clipped=true %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>You can append icons to <strong>select dropdowns</strong> as well.</p>
2018-04-09 15:15:58 +00:00
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=select_icons_example %}
2017-07-17 14:51:22 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
If the control contains an icon, Bulma will make sure the icon remains <strong>centered</strong>, no matter the size
of the input <em>or</em> of the icon.
2018-04-09 15:15:58 +00:00
</p>
</div>
2017-07-17 14:51:22 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=has_icons_small_example %}
2017-07-17 14:51:22 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=has_icons_normal_example clipped=true %}
2017-07-17 14:51:22 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=has_icons_medium_example clipped=true %}
2017-07-17 14:51:22 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=has_icons_large_example clipped=true %}
2017-07-17 14:51:22 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Form addons" %}
2017-07-17 14:51:22 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
If you want to <strong>attach controls</strong> together, use the <code>has-addons</code> modifier on the
<code>field</code> container:
</p>
2018-04-09 15:15:58 +00:00
</div>
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=addons_example %}
2017-08-30 21:21:30 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
<p>You can attach inputs, buttons, and dropdowns <strong>only</strong>.</p>
</div>
2017-08-30 21:21:30 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
It can be useful to append a <a href="{{site.url}}/documentation/elements/button#static-button">static button</a>.
</p>
2018-04-09 15:15:58 +00:00
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=addons_static_example %}
2017-08-30 21:21:30 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
Use the <code>is-expanded</code> modifier on the element you want to fill up the remaining space (in this case, the
input):
</p>
2018-04-09 15:15:58 +00:00
</div>
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=addons_expanded_example horizontal=true more=true %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
If you want a full width select dropdown, pair <code>control is-expanded</code> with
<code>select is-fullwidth</code>.
</p>
2018-04-09 15:15:58 +00:00
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=addons_expanded_fullwidth_example %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
Use the <code>has-addons-centered</code> or the <code>has-addons-right</code> modifiers to alter the
<strong>alignment</strong>.
</p>
2018-04-09 15:15:58 +00:00
</div>
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=addons_center_example %}
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=addons_right_example %}
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Form group" %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
If you want to <strong>group</strong> controls together, use the <code>is-grouped</code> modifier on the
<code>field</code> container.
2018-04-09 15:15:58 +00:00
</p>
</div>
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=group_example %}
2017-08-30 21:21:30 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
Use the <code>is-grouped-centered</code> or the <code>is-grouped-right</code> modifiers to alter the
<strong>alignment</strong>.
2018-04-09 15:15:58 +00:00
</p>
</div>
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=group_centered_example %}
2017-07-17 14:05:39 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=group_right_example %}
2017-07-24 18:45:21 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
Add the <code>is-expanded</code> modifier on the control element you want to
<strong>fill up the remaining space</strong> with.
2018-04-09 15:15:58 +00:00
</p>
</div>
2017-07-24 18:45:21 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=group_expanded_example %}
2017-07-24 18:45:21 +00:00
2018-04-09 15:15:58 +00:00
<div id="form-group-multiline" class="content">
<p>
2024-03-21 16:11:54 +00:00
Add the <code>is-grouped-multiline</code> modifier to allow controls to fill up <strong>multiple lines</strong>.
This is ideal for a long list of controls.
2018-04-09 15:15:58 +00:00
</p>
</div>
2017-07-24 18:45:21 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=group_multiline_example clipped=true %}
2017-07-24 18:45:21 +00:00
2018-04-09 15:15:58 +00:00
<div class="message is-info">
<div class="message-header">
<p>List of buttons</p>
</div>
<div class="message-body">
2017-07-24 18:45:21 +00:00
<div class="content">
2017-07-17 14:05:39 +00:00
<p>
2024-03-21 16:11:54 +00:00
If you only need a list of <em>buttons</em>, try out the new <code>buttons</code> class with which you can
create a <a href="{{ site.url }}/documentation/elements/button/#list-of-buttons">multiline list of buttons</a>.
2017-07-24 18:45:21 +00:00
</p>
</div>
2018-04-09 15:15:58 +00:00
</div>
</div>
2017-07-24 18:45:21 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Horizontal form" %}
2018-04-09 15:15:58 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
If you want a <strong>horizontal</strong> form control, use the <code>is-horizontal</code> modifier on the
<code>field</code> container, in which you include:
</p>
2018-04-09 15:15:58 +00:00
<ul>
2024-03-21 16:11:54 +00:00
<li><code>field-label</code> for the side label</li>
<li><code>field-body</code> for the input/select/textarea container</li>
2018-04-09 15:15:58 +00:00
</ul>
<p>You can use <code>is-grouped</code> or <code>has-addons</code> for the child elements.</p>
</div>
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=horizontal_form_example horizontal=true more=true %}
2017-07-17 14:05:39 +00:00
2018-04-09 15:15:58 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
To preserve the <strong>vertical alignment</strong> of labels with each type and size of control, the
<code>field-label</code> comes with <strong>4 size modifiers</strong>:
2018-04-09 15:15:58 +00:00
</p>
<ul>
<li>
2019-10-13 19:06:56 +00:00
<code>is-small</code>
2018-04-09 15:15:58 +00:00
</li>
2024-03-21 16:11:54 +00:00
<li><code>is-normal</code> for any <code>input</code> or <code>button</code></li>
2018-04-09 15:15:58 +00:00
<li>
2019-10-13 19:06:56 +00:00
<code>is-medium</code>
2018-04-09 15:15:58 +00:00
</li>
<li>
2019-10-13 19:06:56 +00:00
<code>is-large</code>
2018-04-09 15:15:58 +00:00
</li>
</ul>
</div>
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=field_label_example horizontal=true more=true %}
2017-10-17 10:53:44 +00:00
2018-06-19 12:33:54 +00:00
{% capture custom_message %}
Form elements can be <strong>customized</strong> using the following generic variables. Simply set one or multiple of these variables <em>before</em> importing Bulma. <a href="{{ site.url }}/documentation/overview/customize/">Learn how</a>.
{% endcapture %}
2017-08-30 21:21:30 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Disabled form" %}
2018-10-31 18:48:13 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
You can disable part or a whole form by wrapping a set of controls in a <strong>fieldset</strong> with a
<code>disabled</code> HTML attribute.
2018-10-31 18:48:13 +00:00
</p>
</div>
2024-03-21 16:11:54 +00:00
{% include docs/elements/snippet.html content=disabled_fields_example %}
2018-10-31 18:48:13 +00:00
2024-03-21 16:11:54 +00:00
{%
include docs/components/variables.html
anchor_name='Control variables'
2018-06-19 12:33:54 +00:00
type='element'
variables_keys=page.variables_control_keys
custom_message=custom_message
folder='utilities'
file='controls'
%}