2017-07-17 18:41:58 +00:00
|
|
|
---
|
2017-07-29 12:02:00 +00:00
|
|
|
title: Checkbox
|
2024-03-21 16:11:54 +00:00
|
|
|
layout: docs
|
|
|
|
theme: library
|
2017-07-17 18:41:58 +00:00
|
|
|
doc-tab: form
|
|
|
|
doc-subtab: checkbox
|
2018-04-09 15:15:58 +00:00
|
|
|
breadcrumb:
|
2024-03-21 16:11:54 +00:00
|
|
|
- home
|
|
|
|
- documentation
|
|
|
|
- form
|
|
|
|
- form-checkbox
|
2018-04-09 15:15:58 +00:00
|
|
|
meta:
|
|
|
|
colors: false
|
|
|
|
sizes: false
|
|
|
|
variables: false
|
2017-07-17 18:41:58 +00:00
|
|
|
---
|
2024-07-07 16:59:24 +00:00
|
|
|
|
2017-07-17 18:41:58 +00:00
|
|
|
{% capture checkbox_example %}
|
|
|
|
<label class="checkbox">
|
2024-03-21 16:11:54 +00:00
|
|
|
<input type="checkbox" />
|
2017-07-17 18:41:58 +00:00
|
|
|
Remember me
|
|
|
|
</label>
|
2024-07-07 16:59:24 +00:00
|
|
|
{% endcapture %} {% capture checkbox_link_example %}
|
2017-07-17 18:41:58 +00:00
|
|
|
<label class="checkbox">
|
2024-03-21 16:11:54 +00:00
|
|
|
<input type="checkbox" />
|
2017-07-17 18:41:58 +00:00
|
|
|
I agree to the <a href="#">terms and conditions</a>
|
|
|
|
</label>
|
2024-07-07 16:59:24 +00:00
|
|
|
{% endcapture %} {% capture checkbox_disabled_example %}
|
2017-07-17 18:41:58 +00:00
|
|
|
<label class="checkbox" disabled>
|
2024-03-21 16:11:54 +00:00
|
|
|
<input type="checkbox" disabled />
|
2017-07-17 18:41:58 +00:00
|
|
|
Save my preferences
|
|
|
|
</label>
|
2024-07-07 16:59:24 +00:00
|
|
|
{% endcapture %} {% capture list_of_checkboxes %}
|
|
|
|
<div class="checkboxes">
|
|
|
|
<label class="checkbox">
|
|
|
|
<input type="checkbox" />
|
|
|
|
Monday
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="checkbox">
|
|
|
|
<input type="checkbox" />
|
|
|
|
Tuesday
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="checkbox">
|
|
|
|
<input type="checkbox" />
|
|
|
|
Wednesday
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="checkbox">
|
|
|
|
<input type="checkbox" />
|
|
|
|
Thursday
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="checkbox">
|
|
|
|
<input type="checkbox" />
|
|
|
|
Friday
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="checkbox">
|
|
|
|
<input type="checkbox" checked />
|
|
|
|
Saturday
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="checkbox">
|
|
|
|
<input type="checkbox" checked />
|
|
|
|
Sunday
|
|
|
|
</label>
|
|
|
|
</div>
|
2017-07-17 18:41:58 +00:00
|
|
|
{% endcapture %}
|
|
|
|
|
2018-04-09 15:15:58 +00:00
|
|
|
<div class="content">
|
|
|
|
<p>
|
2024-07-07 16:59:24 +00:00
|
|
|
The <code>checkbox</code> class is a simple wrapper around the
|
|
|
|
<code><input type="checkbox"></code> HTML element. It is intentionally
|
|
|
|
not styled, to preserve cross-browser compatibility and the user experience.
|
2018-04-09 15:15:58 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
2017-07-17 18:41:58 +00:00
|
|
|
|
2018-04-09 15:15:58 +00:00
|
|
|
<div class="columns">
|
2024-03-21 16:11:54 +00:00
|
|
|
<div class="column is-half">{{ checkbox_example }}</div>
|
2021-01-27 23:30:42 +00:00
|
|
|
<div class="column is-half bd-highlight-full">
|
2024-07-07 16:59:24 +00:00
|
|
|
{% highlight html -%} {{- checkbox_example -}} {%- endhighlight %}
|
2018-04-09 15:15:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-17 18:41:58 +00:00
|
|
|
|
2018-04-09 15:15:58 +00:00
|
|
|
<div class="content">
|
2024-07-07 16:59:24 +00:00
|
|
|
<p>
|
|
|
|
You can add <strong>links</strong> to your checkbox, or even
|
|
|
|
<strong>disable</strong> it.
|
|
|
|
</p>
|
2018-04-09 15:15:58 +00:00
|
|
|
</div>
|
2017-07-17 18:41:58 +00:00
|
|
|
|
2018-04-09 15:15:58 +00:00
|
|
|
<div class="columns">
|
2024-03-21 16:11:54 +00:00
|
|
|
<div class="column is-half">{{ checkbox_link_example }}</div>
|
2021-01-27 23:30:42 +00:00
|
|
|
<div class="column is-half bd-highlight-full">
|
2024-07-07 16:59:24 +00:00
|
|
|
{% highlight html -%} {{- checkbox_link_example -}} {%- endhighlight %}
|
2018-04-09 15:15:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-17 18:41:58 +00:00
|
|
|
|
2018-04-09 15:15:58 +00:00
|
|
|
<div class="columns">
|
2024-03-21 16:11:54 +00:00
|
|
|
<div class="column is-half">{{ checkbox_disabled_example }}</div>
|
2021-01-27 23:30:42 +00:00
|
|
|
<div class="column is-half bd-highlight-full">
|
2024-07-07 16:59:24 +00:00
|
|
|
{% highlight html -%} {{- checkbox_disabled_example -}} {%- endhighlight %}
|
2017-07-17 18:41:58 +00:00
|
|
|
</div>
|
2018-04-09 15:15:58 +00:00
|
|
|
</div>
|
2024-07-07 16:59:24 +00:00
|
|
|
|
|
|
|
{% include docs/elements/anchor.html name="List of Checkboxes" %}
|
|
|
|
|
|
|
|
<div class="content">
|
|
|
|
<p>
|
|
|
|
If you want to list several checkbox elements, wrap them in a
|
|
|
|
<code><div class="checkboxes"></code> element:
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="block">{{- list_of_checkboxes -}}</div>
|
|
|
|
|
|
|
|
{% highlight html -%} {{- list_of_checkboxes -}} {%- endhighlight %}
|