mirror of
https://github.com/jgthms/bulma
synced 2026-03-15 02:04:29 -07:00
Container broken layout
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
---
|
||||
title: Form controls
|
||||
subtitle: "All generic <strong>form controls</strong>, designed for consistency"
|
||||
layout: documentation
|
||||
doc-tab: form
|
||||
doc-subtab: general
|
||||
breadcrumb:
|
||||
- home
|
||||
- documentation
|
||||
- form
|
||||
- form-general
|
||||
variables_controls_keys:
|
||||
- control-radius
|
||||
- control-radius-small
|
||||
@@ -795,292 +801,278 @@ variables_form_keys:
|
||||
</div>
|
||||
{% endcapture %}
|
||||
|
||||
{% include subnav/subnav-form.html %}
|
||||
<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>
|
||||
|
||||
<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>
|
||||
{% include snippet.html content=example more=true %}
|
||||
|
||||
<hr>
|
||||
{% include anchor.html name="Form field" %}
|
||||
|
||||
<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="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>
|
||||
|
||||
{% include snippet.html content=example more=true %}
|
||||
{% include snippet.html content=field_example %}
|
||||
|
||||
{% include anchor.html name="Form field" %}
|
||||
<div class="content">
|
||||
<p>This container allows form fields to be <strong>spaced consistently</strong>.</p>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
{% include snippet.html content=fields_example %}
|
||||
|
||||
{% include snippet.html content=field_example %}
|
||||
{% include anchor.html name="Form control" %}
|
||||
|
||||
<div class="content">
|
||||
<p>This container allows form fields to be <strong>spaced consistently</strong>.</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>The <code>control</code> is a versatile container meant to <strong>enhance single form controls</strong>. Because it has the same height as a control elements, it can <strong class="has-text-danger">only contain</strong> the following elements:</p>
|
||||
<ul>
|
||||
<li><code>input</code></li>
|
||||
<li><code>select</code></li>
|
||||
<li><code>button</code></li>
|
||||
<li><code>icon</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=fields_example %}
|
||||
{% include snippet.html content=control_input_example %}
|
||||
|
||||
{% include anchor.html name="Form control" %}
|
||||
{% include snippet.html content=control_select_example %}
|
||||
|
||||
<div class="content">
|
||||
<p>The <code>control</code> is a versatile container meant to <strong>enhance single form controls</strong>. Because it has the same height as a control elements, it can <strong class="has-text-danger">only contain</strong> the following elements:</p>
|
||||
<ul>
|
||||
<li><code>input</code></li>
|
||||
<li><code>select</code></li>
|
||||
<li><code>button</code></li>
|
||||
<li><code>icon</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% include snippet.html content=control_button_example %}
|
||||
|
||||
{% include snippet.html content=control_input_example %}
|
||||
<!-- Font Awesome Icons -->
|
||||
{% include anchor.html name="With icons" %}
|
||||
|
||||
{% include snippet.html content=control_select_example %}
|
||||
<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>
|
||||
|
||||
{% include snippet.html content=control_button_example %}
|
||||
{% include snippet.html content=icons_example clipped=true %}
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
{% include anchor.html name="With icons" %}
|
||||
<div class="content">
|
||||
<p>
|
||||
You can append icons to <strong>select dropdowns</strong> as well.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
{% include snippet.html content=select_icons_example %}
|
||||
|
||||
{% include snippet.html content=icons_example clipped=true %}
|
||||
<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="content">
|
||||
<p>
|
||||
You can append icons to <strong>select dropdowns</strong> as well.
|
||||
</p>
|
||||
</div>
|
||||
{% include snippet.html content=has_icons_small_example %}
|
||||
|
||||
{% include snippet.html content=select_icons_example %}
|
||||
{% include snippet.html content=has_icons_normal_example clipped=true %}
|
||||
|
||||
<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>
|
||||
{% include snippet.html content=has_icons_medium_example clipped=true %}
|
||||
|
||||
{% include snippet.html content=has_icons_small_example %}
|
||||
{% include snippet.html content=has_icons_large_example clipped=true %}
|
||||
|
||||
{% include snippet.html content=has_icons_normal_example clipped=true %}
|
||||
{% include anchor.html name="Form addons" %}
|
||||
|
||||
{% include snippet.html content=has_icons_medium_example clipped=true %}
|
||||
<div class="content">
|
||||
<p>If you want to <strong>attach controls</strong> together, use the <code>has-addons</code> modifier on the <code>field</code> container:</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=has_icons_large_example clipped=true %}
|
||||
{% include snippet.html content=addons_example %}
|
||||
|
||||
{% include anchor.html name="Form addons" %}
|
||||
<div class="content">
|
||||
<p>You can attach inputs, buttons, and dropdowns <strong>only</strong>.</p>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<p>If you want to <strong>attach controls</strong> together, use the <code>has-addons</code> modifier on the <code>field</code> container:</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>It can be useful to append a <a href="{{site.url}}/documentation/elements/button#static-button">static button</a>.</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=addons_example %}
|
||||
{% include snippet.html content=addons_static_example %}
|
||||
|
||||
<div class="content">
|
||||
<p>You can attach inputs, buttons, and dropdowns <strong>only</strong>.</p>
|
||||
</div>
|
||||
<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="content">
|
||||
<p>It can be useful to append a <a href="{{site.url}}/documentation/elements/button#static-button">static button</a>.</p>
|
||||
</div>
|
||||
{% include snippet.html content=addons_expanded_example horizontal=true more=true %}
|
||||
|
||||
{% include snippet.html content=addons_static_example %}
|
||||
<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="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>
|
||||
{% include snippet.html content=addons_expanded_fullwidth_example %}
|
||||
|
||||
{% include snippet.html content=addons_expanded_example horizontal=true more=true %}
|
||||
<div class="content">
|
||||
<p>Use the <code>has-addons-centered</code> or the <code>has-addons-right</code> modifiers to alter the <strong>alignment</strong>.</p>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
{% include snippet.html content=addons_center_example %}
|
||||
|
||||
{% include snippet.html content=addons_expanded_fullwidth_example %}
|
||||
{% include snippet.html content=addons_right_example %}
|
||||
|
||||
<div class="content">
|
||||
<p>Use the <code>has-addons-centered</code> or the <code>has-addons-right</code> modifiers to alter the <strong>alignment</strong>.</p>
|
||||
</div>
|
||||
{% include anchor.html name="Form group" %}
|
||||
|
||||
{% include snippet.html content=addons_center_example %}
|
||||
<div class="content">
|
||||
<p>
|
||||
If you want to <strong>group</strong> controls together, use the <code>is-grouped</code> modifier on the <code>field</code> container.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=addons_right_example %}
|
||||
{% include snippet.html content=group_example %}
|
||||
|
||||
{% include anchor.html name="Form group" %}
|
||||
<div class="content">
|
||||
Use the <code>is-grouped-centered</code> or the <code>is-grouped-right</code> modifiers to alter the <strong>alignment</strong>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<p>
|
||||
If you want to <strong>group</strong> controls together, use the <code>is-grouped</code> modifier on the <code>field</code> container.
|
||||
</p>
|
||||
</div>
|
||||
{% include snippet.html content=group_centered_example %}
|
||||
|
||||
{% include snippet.html content=group_example %}
|
||||
{% include snippet.html content=group_right_example %}
|
||||
|
||||
<div class="content">
|
||||
Use the <code>is-grouped-centered</code> or the <code>is-grouped-right</code> modifiers to alter the <strong>alignment</strong>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>
|
||||
Add the <code>is-expanded</code> modifier on the control element you want to <strong>fill up the remaining space</strong> with.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=group_centered_example %}
|
||||
{% include snippet.html content=group_expanded_example %}
|
||||
|
||||
{% include snippet.html content=group_right_example %}
|
||||
<div id="form-group-multiline" class="content">
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<p>
|
||||
Add the <code>is-expanded</code> modifier on the control element you want to <strong>fill up the remaining space</strong> with.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=group_expanded_example %}
|
||||
|
||||
<div id="form-group-multiline" class="content">
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=group_multiline_example clipped=true %}
|
||||
|
||||
<div class="message is-info">
|
||||
<div class="message-header">
|
||||
<p>List of buttons</p>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
<div class="content">
|
||||
<p>
|
||||
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>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include anchor.html name="Horizontal form" %}
|
||||
|
||||
<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 use <code>is-grouped</code> or <code>has-addons</code> for the child elements.</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=horizontal_form_example horizontal=true more=true %}
|
||||
|
||||
<div class="content">
|
||||
<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>
|
||||
|
||||
{% include snippet.html content=field_label_example horizontal=true more=true %}
|
||||
|
||||
{% include anchor.html name="Variables" %}
|
||||
|
||||
<div class="content">
|
||||
<p>
|
||||
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>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<table class="table is-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Default value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Default value</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
{% for key in page.variables_controls_keys %}
|
||||
{% assign variable = site.data.variables.utilities.controls.vars[key] %}
|
||||
<tr>
|
||||
<td>
|
||||
<code>{{ variable.name }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ variable.value }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for key in page.variables_form_keys %}
|
||||
{% assign variable = site.data.variables.elements.form.vars[key] %}
|
||||
<tr>
|
||||
<td>
|
||||
<code>{{ variable.name }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ variable.value }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include snippet.html content=group_multiline_example clipped=true %}
|
||||
|
||||
<div class="message is-info">
|
||||
<div class="message-header">
|
||||
<p>List of buttons</p>
|
||||
</div>
|
||||
</section>
|
||||
<div class="message-body">
|
||||
<div class="content">
|
||||
<p>
|
||||
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>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include anchor.html name="Horizontal form" %}
|
||||
|
||||
<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 use <code>is-grouped</code> or <code>has-addons</code> for the child elements.</p>
|
||||
</div>
|
||||
|
||||
{% include snippet.html content=horizontal_form_example horizontal=true more=true %}
|
||||
|
||||
<div class="content">
|
||||
<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>
|
||||
|
||||
{% include snippet.html content=field_label_example horizontal=true more=true %}
|
||||
|
||||
{% include anchor.html name="Variables" %}
|
||||
|
||||
<div class="content">
|
||||
<p>
|
||||
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>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<table class="table is-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Default value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Default value</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
{% for key in page.variables_controls_keys %}
|
||||
{% assign variable = site.data.variables.utilities.controls.vars[key] %}
|
||||
<tr>
|
||||
<td>
|
||||
<code>{{ variable.name }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ variable.value }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for key in page.variables_form_keys %}
|
||||
{% assign variable = site.data.variables.elements.form.vars[key] %}
|
||||
<tr>
|
||||
<td>
|
||||
<code>{{ variable.name }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ variable.value }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user