<!-- SWITCH-GROUP Component -->
<div class="kx-switchgroup kx-switchgroup--inline">
<div class="kx-switchgroup__inner">
<!-- SWITCH checkbox Component -->
<div class="kx-switch kx-switch--checkbox">
<label class="kx-switch__label" for="foo--10911">
<input class="kx-switch__control kx-is-vishidden" type="checkbox" id="foo--10911" />
<span class="kx-switch__fake" aria-hidden="true"></span>
<span class="kx-switch__label__txt">foo</span>
</label>
</div>
<!-- SWITCH checkbox Component -->
<div class="kx-switch kx-switch--checkbox">
<label class="kx-switch__label" for="bar--64678">
<input class="kx-switch__control kx-is-vishidden" type="checkbox" id="bar--64678" />
<span class="kx-switch__fake" aria-hidden="true"></span>
<span class="kx-switch__label__txt">bar</span>
</label>
</div>
<!-- SWITCH checkbox Component -->
<div class="kx-switch kx-switch--checkbox">
<label class="kx-switch__label" for="baz--86081">
<input class="kx-switch__control kx-is-vishidden" type="checkbox" id="baz--86081" />
<span class="kx-switch__fake" aria-hidden="true"></span>
<span class="kx-switch__label__txt">baz</span>
</label>
</div>
</div>
</div>
<!-- SWITCH-GROUP Component -->
<div class="kx-switchgroup{% if inline %} kx-switchgroup--inline{% endif %}{% for class in classes %} {{ class }}{% endfor %}">
<div class="kx-switchgroup__inner">
{% for switcher in switches -%}
{% render '@switch', switcher.context, true %}
{% endfor -%}
</div>
</div>
{
"classes": null,
"inline": true
}
-
Content:
// ========================================================================== // Component: switchgroup (Shared styles for radiobuttons & checkboxes) // ========================================================================== // Elements (children) // ========================================================================== // Block (parent) // ========================================================================== .kx-switchgroup { overflow: hidden; position: relative; .kx-switchgroup__inner { @include flex; @include flex-row; @include flex-wrap; margin-top: -1rem; } .kx-switch { @include mt(base); flex-basis: 100%; } > * { flex-basis: 100%; } } // Modifiers // ========================================================================== .kx-switchgroup--inline { .kx-switchgroup__inner { @include flex; @include flex-row; @include flex-wrap; } .kx-switch { // If number of switches within a switchgroup with modifier --inline is // more than 3, we force a stacked view. @include at-most(3) { @include m(base, large, none, none); display: inline-block; flex-basis: auto; } } }
- URL: /components/raw/switch-group/_switch-group.scss
- Filesystem Path: src\components\01-form\switch-group\_switch-group.scss
- Size: 1.3 KB
- Handle: @switch-group
- Variants (5): Type: Checkbox Group , Type: Radio Group , Type: Toggle Group , Vertical , Auto Vertical
- Preview:
- Filesystem Path: src\components\01-form\switch-group\switch-group.njk
- References (1): @switch
There are no notes for this item.