bulma/docs/documentation/elements/form.html

1213 lines
31 KiB
HTML
Raw Normal View History

---
layout: documentation
doc-tab: elements
doc-subtab: form
---
2017-07-17 18:41:58 +00:00
<meta http-equiv="refresh" content="0; url={{ site.url }}/documentation/form/general/">
2016-10-30 14:59:46 +00:00
{% capture form_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
2017-03-12 17:37:22 +00:00
<label class="label">Name</label>
2017-03-12 17:29:26 +00:00
<p class="control">
<input class="input" type="text" placeholder="Text input">
</p>
</div>
<div class="field">
<label class="label">Username</label>
2017-04-15 14:55:03 +00:00
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-success" type="text" placeholder="Text input" value="bulma">
2017-04-15 14:55:03 +00:00
<span class="icon is-small is-left">
<i class="fa fa-user"></i>
</span>
<span class="icon is-small is-right">
2017-03-12 17:29:26 +00:00
<i class="fa fa-check"></i>
</span>
</p>
<p class="help is-success">This username is available</p>
</div>
<div class="field">
<label class="label">Email</label>
2017-04-15 14:55:03 +00:00
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-danger" type="text" placeholder="Email input" value="hello@">
2017-04-15 14:55:03 +00:00
<span class="icon is-small is-left">
<i class="fa fa-envelope"></i>
</span>
<span class="icon is-small is-right">
2017-03-12 17:29:26 +00:00
<i class="fa fa-warning"></i>
</span>
</p>
<p class="help is-danger">This email is invalid</p>
</div>
<div class="field">
<label class="label">Subject</label>
<p class="control">
<span class="select">
<select>
<option>Select dropdown</option>
<option>With options</option>
</select>
</span>
</p>
</div>
<div class="field">
<label class="label">Message</label>
<p class="control">
<textarea class="textarea" placeholder="Textarea"></textarea>
</p>
</div>
<div class="field">
<p class="control">
<label class="checkbox">
<input type="checkbox">
2017-04-15 13:51:59 +00:00
I agree to the <a href="#">terms and conditions</a>
2017-03-12 17:29:26 +00:00
</label>
</p>
</div>
<div class="field">
<p class="control">
<label class="radio">
<input type="radio" name="question">
Yes
</label>
<label class="radio">
<input type="radio" name="question">
No
</label>
</p>
</div>
<div class="field is-grouped">
2016-10-30 10:41:53 +00:00
<p class="control">
<button class="button is-primary">Submit</button>
</p>
<p class="control">
<button class="button is-link">Cancel</button>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
{% capture colors_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control">
<input class="input is-primary" type="text" placeholder="Primary input">
</p>
</div>
<div class="field">
<p class="control">
<input class="input is-info" type="text" placeholder="Info input">
</p>
</div>
<div class="field">
<p class="control">
<input class="input is-success" type="text" placeholder="Success input">
</p>
</div>
<div class="field">
<p class="control">
<input class="input is-warning" type="text" placeholder="Warning input">
</p>
</div>
<div class="field">
<p class="control">
<input class="input is-danger" type="text" placeholder="Danger input">
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2016-10-30 14:59:46 +00:00
{% capture sizes_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control">
<input class="input is-small" type="text" placeholder="Small input">
</p>
</div>
<div class="field">
<p class="control">
<input class="input" type="text" placeholder="Normal input">
</p>
</div>
<div class="field">
<p class="control">
<input class="input is-medium" type="text" placeholder="Medium input">
</p>
</div>
<div class="field">
<p class="control">
<input class="input is-large" type="text" placeholder="Large input">
</p>
</div>
<div class="field">
<p class="control">
<span class="select is-small">
<select>
<option>Select dropdown</option>
<option>With options</option>
</select>
</span>
</p>
</div>
<div class="field">
<p class="control">
<span class="select">
<select>
<option>Select dropdown</option>
<option>With options</option>
</select>
</span>
</p>
</div>
<div class="field">
<p class="control">
<span class="select is-medium">
<select>
<option>Select dropdown</option>
<option>With options</option>
</select>
</span>
</p>
</div>
<div class="field">
<p class="control">
<span class="select is-large">
<select>
<option>Select dropdown</option>
<option>With options</option>
</select>
</span>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2016-10-30 14:59:46 +00:00
{% capture normal_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control">
<input class="input" type="text" placeholder="Normal input">
</p>
</div>
<div class="field">
<p class="control">
<textarea class="textarea" placeholder="Normal textarea"></textarea>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
{% capture hover_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control">
<input class="input is-hovered" type="text" placeholder="Hovered input">
</p>
</div>
<div class="field">
<p class="control">
<textarea class="textarea is-hovered" placeholder="Hovered textarea"></textarea>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
{% capture focus_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control">
<input class="input is-focused" type="text" placeholder="Focused input">
</p>
</div>
<div class="field">
<p class="control">
<textarea class="textarea is-focused" placeholder="Focused textarea"></textarea>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
{% capture loading_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control is-loading">
<input class="input" type="text" placeholder="Loading input">
</p>
</div>
2017-04-13 00:10:39 +00:00
<div class="field">
<div class="control">
<div class="select is-loading">
<select>
<option>Loading dropdown</option>
</select>
</div>
</div>
</div>
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control is-loading">
<textarea class="textarea" placeholder="Loading textarea"></textarea>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-06-27 21:57:13 +00:00
{% capture loading_sizes_example %}
<div class="field">
<p class="control is-small is-loading">
<input class="input is-small" type="text" placeholder="Small loading input">
</p>
</div>
<div class="field">
<p class="control is-loading">
<input class="input" type="text" placeholder="Normal loading input">
</p>
</div>
<div class="field">
<p class="control is-medium is-loading">
<input class="input is-medium" type="text" placeholder="Medium loading input">
</p>
</div>
<div class="field">
<p class="control is-large is-loading">
<input class="input is-large" type="text" placeholder="Large loading input">
</p>
</div>
<div class="field">
<div class="control">
<div class="select is-small is-loading">
<select>
<option>Small loading dropdown</option>
</select>
</div>
</div>
</div>
<div class="field">
<div class="control">
<div class="select is-loading">
<select>
<option>Normal loading dropdown</option>
</select>
</div>
</div>
</div>
<div class="field">
<div class="control">
<div class="select is-medium is-loading">
<select>
<option>Medium loading dropdown</option>
</select>
</div>
</div>
</div>
<div class="field">
<div class="control">
<div class="select is-large is-loading">
<select>
<option>Large loading dropdown</option>
</select>
</div>
</div>
</div>
{% endcapture %}
2016-10-30 14:59:46 +00:00
{% capture disabled_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control">
<input class="input" type="text" placeholder="Disabled input" disabled>
</p>
</div>
2017-04-13 00:10:39 +00:00
<div class="field">
<div class="control">
<div class="select is-disabled">
<select disabled>
<option>Disabled dropdown</option>
</select>
</div>
</div>
</div>
2017-03-12 17:29:26 +00:00
<div class="field">
<p class="control">
<textarea class="textarea" placeholder="Disabled textarea" disabled></textarea>
</p>
</div>
<div class="field">
<p class="control">
<label class="checkbox" disabled>
2017-03-12 17:29:26 +00:00
<input type="checkbox" disabled>
Remember me
</label>
</p>
</div>
<div class="field">
<p class="control">
<label class="radio" disabled>
2017-03-12 17:29:26 +00:00
<input type="radio" name="question" disabled>
Yes
</label>
<label class="radio" disabled>
2017-03-12 17:29:26 +00:00
<input type="radio" name="question" disabled>
No
</label>
</p>
</div>
<div class="field is-grouped">
2016-10-30 10:41:53 +00:00
<p class="control">
<button class="button is-primary" disabled>Submit</button>
</p>
<p class="control">
<button class="button" disabled>Cancel</button>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-04-15 14:49:38 +00:00
2016-10-30 14:59:46 +00:00
{% capture icons_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left">
2017-03-12 17:29:26 +00:00
<input class="input" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
</p>
</div>
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left">
2017-03-12 17:29:26 +00:00
<input class="input" type="password" placeholder="Password">
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-lock"></i>
</span>
</p>
</div>
<div class="field">
<p class="control">
<button class="button is-success">
Login
</button>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-05-27 20:02:31 +00:00
{% 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">
<i class="fa fa-globe"></i>
</span>
</p>
</div>
{% endcapture %}
2017-04-15 14:49:38 +00:00
{% capture has_icons_small_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<label class="label is-small">Small input</label>
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-small" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-right">
<i class="fa fa-check"></i>
</span>
2017-03-12 17:29:26 +00:00
</p>
</div>
2017-04-15 14:49:38 +00:00
{% endcapture %}
{% capture has_icons_normal_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<label class="label">Normal input</label>
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-right">
<i class="fa fa-check"></i>
</span>
2017-03-12 17:29:26 +00:00
</p>
</div>
2017-04-15 14:49:38 +00:00
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-right">
<i class="fa fa-check"></i>
</span>
2017-03-12 17:29:26 +00:00
</p>
</div>
2017-04-15 14:49:38 +00:00
{% endcapture %}
{% capture has_icons_medium_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<label class="label is-medium">Medium input</label>
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-medium" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-right">
<i class="fa fa-check"></i>
</span>
2017-03-12 17:29:26 +00:00
</p>
</div>
2017-04-15 14:49:38 +00:00
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-medium" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-right">
<i class="fa fa-check"></i>
</span>
2017-03-12 17:29:26 +00:00
</p>
</div>
2017-04-15 14:49:38 +00:00
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-medium" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-medium is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-medium is-right">
<i class="fa fa-check"></i>
2017-03-12 17:29:26 +00:00
</span>
</p>
</div>
2017-04-15 14:49:38 +00:00
{% endcapture %}
{% capture has_icons_large_example %}
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<label class="label is-large">Large input</label>
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-large" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-small is-right">
<i class="fa fa-check"></i>
</span>
2017-03-12 17:29:26 +00:00
</p>
</div>
2017-04-15 14:49:38 +00:00
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-large" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-left">
2017-03-12 17:29:26 +00:00
<i class="fa fa-envelope"></i>
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-right">
2017-03-12 17:29:26 +00:00
<i class="fa fa-check"></i>
</span>
</p>
</div>
2017-04-15 14:49:38 +00:00
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left has-icons-right">
<input class="input is-large" type="email" placeholder="Email">
<span class="icon is-medium is-left">
<i class="fa fa-envelope"></i>
2017-03-12 17:29:26 +00:00
</span>
2017-04-15 14:49:38 +00:00
<span class="icon is-medium is-right">
2017-03-12 17:29:26 +00:00
<i class="fa fa-check"></i>
</span>
</p>
</div>
2017-04-15 14:49:38 +00:00
2017-03-12 17:29:26 +00:00
<div class="field">
2017-04-15 14:49:38 +00:00
<p class="control has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-large" type="email" placeholder="Email">
2017-04-15 14:49:38 +00:00
<span class="icon is-large is-left">
<i class="fa fa-envelope"></i>
</span>
<span class="icon is-large is-right">
2017-03-12 17:29:26 +00:00
<i class="fa fa-check"></i>
</span>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-04-15 14:49:38 +00:00
2016-10-30 14:59:46 +00:00
{% capture addons_example %}
2017-03-12 17:29:26 +00:00
<div class="field has-addons">
<p class="control">
<input class="input" type="text" placeholder="Find a repository">
</p>
<p class="control">
<a class="button is-info">
Search
</a>
</p>
2017-03-17 00:14:11 +00:00
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-05-28 15:07:29 +00:00
{% 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 %}
2016-10-30 14:59:46 +00:00
{% capture addons_expanded_example %}
2017-03-12 17:29:26 +00:00
<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">
<a class="button">
Transfer
</a>
</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">
<a class="button">
Transfer
</a>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-04-02 16:37:22 +00:00
{% capture addons_expanded_fullwidth_example %}
<div class="field has-addons">
<p class="control is-expanded">
<span class="select is-fullwidth">
<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>
</span>
</p>
<p class="control">
<button type="submit" class="button is-primary">Choose</button>
</p>
</div>
{% endcapture %}
2016-10-30 14:59:46 +00:00
{% capture addons_center_example %}
2017-03-12 17:29:26 +00:00
<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">
<a class="button is-primary">
Transfer
</a>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-07-16 19:41:53 +00:00
2016-10-30 14:59:46 +00:00
{% capture addons_right_example %}
2017-03-12 17:29:26 +00:00
<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">
<a class="button is-primary">
Transfer
</a>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2016-10-30 14:59:46 +00:00
{% capture group_example %}
2017-03-12 17:29:26 +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">
<a class="button is-info">
Search
</a>
</p>
</div>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2016-10-30 14:59:46 +00:00
{% capture horizontal_form_example %}
2017-03-12 17:29:26 +00:00
<div class="field is-horizontal">
2017-03-17 00:14:11 +00:00
<div class="field-label is-normal">
<label class="label">From</label>
</div>
2017-03-12 17:29:26 +00:00
<div class="field-body">
<div class="field is-grouped">
2017-04-15 14:55:03 +00:00
<p class="control is-expanded has-icons-left">
2017-03-12 17:29:26 +00:00
<input class="input" type="text" placeholder="Name">
2017-04-15 14:55:03 +00:00
<span class="icon is-small is-left">
<i class="fa fa-user"></i>
</span>
2017-03-12 17:29:26 +00:00
</p>
</div>
<div class="field">
2017-04-15 14:55:03 +00:00
<p class="control is-expanded has-icons-left has-icons-right">
2017-03-12 17:29:26 +00:00
<input class="input is-success" type="email" placeholder="Email" value="alex@smith.com">
2017-04-15 14:55:03 +00:00
<span class="icon is-small is-left">
<i class="fa fa-envelope"></i>
</span>
<span class="icon is-small is-right">
2017-03-12 17:29:26 +00:00
<i class="fa fa-check"></i>
</span>
</p>
<p class="help is-success">This email is correct</p>
2017-03-12 17:29:26 +00:00
</div>
</div>
</div>
2017-03-12 17:29:26 +00:00
<div class="field is-horizontal">
2017-03-17 00:14:11 +00:00
<div class="field-label is-normal">
<label class="label">Department</label>
</div>
2017-03-12 17:29:26 +00:00
<div class="field-body">
<div class="field is-narrow">
2017-03-12 17:29:26 +00:00
<div class="control">
<div class="select is-fullwidth">
<select>
<option>Business development</option>
<option>Marketing</option>
<option>Sales</option>
2017-03-12 17:29:26 +00:00
</select>
</div>
</div>
</div>
</div>
</div>
2017-03-12 17:29:26 +00:00
<div class="field is-horizontal">
<div class="field-label">
2017-03-17 00:14:11 +00:00
<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>
2017-03-12 17:29:26 +00:00
<div class="field is-horizontal">
2017-03-17 00:14:11 +00:00
<div class="field-label is-normal">
<label class="label">Question</label>
</div>
2017-03-12 17:29:26 +00:00
<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>
2017-03-13 17:08:02 +00:00
<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>
2016-10-30 14:59:46 +00:00
{% endcapture %}
2017-03-17 00:14:11 +00:00
{% 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 %}
2017-07-16 19:41:53 +00:00
{% include subnav-elements.html %}
<section class="section">
<div class="container">
<h1 class="title">Form controls</h1>
<h2 class="subtitle">
All generic <strong>form controls</strong>, designed for consistency
</h2>
<hr>
<div class="content">
<p>The following form controls <strong>classes</strong> are supported:</p>
<ul>
<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>
</ul>
<p>Each of them should be wrapped in a <code>.control</code> container.<br>
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.</p>
</div>
<div class="columns">
<div class="column is-half">
{{form_example}}
</div>
<div class="column is-half">
{% highlight html %}{{form_example}}{% endhighlight %}
</div>
</div>
<hr>
<h3 class="title">Colors</h3>
<div class="columns">
<div class="column is-half">
{{colors_example}}
</div>
<div class="column is-half">
{% highlight html %}{{colors_example}}{% endhighlight %}
</div>
</div>
<hr>
<h3 class="title">Sizes</h3>
<div class="columns">
<div class="column is-half">
{{sizes_example}}
</div>
<div class="column is-half">
{% highlight html %}{{sizes_example}}{% endhighlight %}
</div>
</div>
<hr>
<h3 class="title">States</h3>
<h4 class="subtitle">Normal</h4>
<div class="columns">
<div class="column is-half">
{{normal_example}}
</div>
<div class="column is-half">
{% highlight html %}{{normal_example}}{% endhighlight %}
</div>
</div>
<h4 class="subtitle">Hover</h4>
<div class="columns">
<div class="column is-half">
{{hover_example}}
</div>
<div class="column is-half">
{% highlight html %}{{hover_example}}{% endhighlight %}
</div>
</div>
<h4 class="subtitle">Focus</h4>
<div class="columns">
<div class="column is-half">
{{focus_example}}
</div>
<div class="column is-half">
{% highlight html %}{{focus_example}}{% endhighlight %}
</div>
</div>
<h4 class="subtitle">Loading</h4>
<div class="columns">
<div class="column is-half">
{{loading_example}}
</div>
<div class="column is-half">
{% highlight html %}{{loading_example}}{% endhighlight %}
</div>
</div>
{% if site.vernum >= 43 %}
<div class="columns">
<div class="column is-half">
<p style="margin-bottom: 0.5rem;">
<span class="tag is-success">New!</span>
<span class="tag is-info">0.4.3</span>
</p>
<div class="content">
<p>
You can resize the loading spinner by appending <code>is-small</code>, <code>is-medium</code> or <code>is-large</code> to the <code>control</code> container.
</p>
</div>
{{loading_sizes_example}}
</div>
<div class="column is-half">
{% highlight html %}{{loading_sizes_example}}{% endhighlight %}
</div>
</div>
{% endif %}
<h4 class="subtitle">Disabled</h4>
<div class="columns">
<div class="column is-half">
{{disabled_example}}
</div>
<div class="column is-half">
{% highlight html %}{{disabled_example}}{% endhighlight %}
</div>
</div>
<!-- Font Awesome Icons -->
<hr>
<h3 class="title">With icons</h3>
<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>
<li>
and/or <code>has-icons-right</code>
</li>
</ul>
<p>You also need to add a modifier on the <strong>icon</strong>:</p>
<ul>
<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>
</ul>
<p>The size of the <strong>input</strong> will define the size of the icon container.</p>
</div>
<div class="columns">
<div class="column is-half">
{{icons_example}}
</div>
<div class="column is-half">
{% highlight html %}{{icons_example}}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-half">
2017-07-17 18:17:57 +00:00
<div class="content">
<p>
<span class="tag is-success">New!</span>
<span class="tag is-info">0.4.2</span>
</p>
<p>
You can now append icons to <strong>select dropdowns</strong> as well.
</p>
</div>
2017-07-16 19:41:53 +00:00
{{select_icons_example}}
</div>
<div class="column is-half">
{% highlight html %}{{select_icons_example}}{% endhighlight %}
</div>
</div>
<div class="content">
<p>
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.
</p>
</div>
<div class="columns">
<div class="column is-half">
{{has_icons_small_example}}
</div>
<div class="column is-half">
{% highlight html %}{{has_icons_small_example}}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-half">
{{has_icons_normal_example}}
</div>
<div class="column is-half">
{% highlight html %}{{has_icons_normal_example}}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-half">
{{has_icons_medium_example}}
</div>
<div class="column is-half">
{% highlight html %}{{has_icons_medium_example}}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-half">
{{has_icons_large_example}}
</div>
<div class="column is-half">
{% highlight html %}{{has_icons_large_example}}{% endhighlight %}
</div>
</div>
<hr>
<h3 id="form-addons" class="title">Form addons</h3>
<div class="content">
<p>If you want to <strong>attach</strong> controls together, use the <code>has-addons</code> modifier on the <code>control</code> container:</p>
</div>
<div class="example">
{{addons_example}}
</div>
{% highlight html %}{{addons_example}}{% endhighlight %}
<div class="content">
<p>You can attach inputs, buttons, and dropdowns <strong>only</strong>.</p>
</div>
<div class="content">
<p>
<span class="tag is-success">New!</span>
<span class="tag is-info">0.4.2</span>
</p>
<p>It can be useful to append a <a href="{{site.url}}/documentation/elements/button#static-button">static button</a>.</p>
</div>
<div class="example">
{{addons_static_example}}
</div>
{% highlight html %}{{addons_static_example}}{% endhighlight %}
<div class="content">
<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>
</div>
<div class="example">
{{addons_expanded_example}}
</div>
{% highlight html %}{{addons_expanded_example}}{% endhighlight %}
<div class="content">
<p>If you want a full width select dropdown, pair <code>control is-expanded</code> with <code>select is-fullwidth</code>.</p>
</div>
<div class="example">
{{addons_expanded_fullwidth_example}}
</div>
{% highlight html %}{{addons_expanded_fullwidth_example}}{% endhighlight %}
<div class="content">
<p>Use the <code>has-addons-centered</code> or the <code>has-addons-right</code> modifers to alter the <strong>alignment</strong>.</p>
</div>
<div class="example">
{{addons_center_example}}
</div>
{% highlight html %}{{addons_center_example}}{% endhighlight %}
<div class="example">
{{addons_right_example}}
</div>
{% highlight html %}{{addons_right_example}}{% endhighlight %}
<hr>
<h3 class="title">Form group</h3>
<div class="content">
<p>
If you want to <strong>group</strong> controls together, use the <code>is-grouped</code> modifier on the <code>control</code> container.
<br>
Use the <code>is-grouped-centered</code> or the <code>is-grouped-right</code> modifers to alter the <strong>alignment</strong>.
</p>
<p>
Add the <code>is-expanded</code> modifier on the control element you want to <strong>fill up the remaining space</strong>.
</p>
</div>
<div class="example">
{{group_example}}
</div>
{% highlight html %}{{group_example}}{% endhighlight %}
<hr>
<h3 class="title">Horizontal form</h3>
<div class="content">
<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>
<ul>
<li>
<code>field-label</code> for the side label
</li>
<li>
<code>field-body</code> for the input/select/textarea container
</li>
</ul>
<p>You can of course use <code>is-grouped</code> or <code>has-addons</code> for the child elements.</p>
</div>
<div class="example">
{{horizontal_form_example}}
</div>
{% highlight html %}{{horizontal_form_example}}{% endhighlight %}
<div class="content">
<p>
<span class="tag is-success">New!</span>
</p>
<p>
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>:
</p>
<ul>
<li>
<code>.is-small</code>
</li>
<li>
<code>.is-normal</code> for any <code>.input</code> or <code>.button</code>
</li>
<li>
<code>.is-medium</code>
</li>
<li>
<code>.is-large</code>
</li>
</ul>
</div>
<div class="example">
{{field_label_example}}
</div>
{% highlight html %}{{field_label_example}}{% endhighlight %}
</div>
</section>