Button Groups

Button groups combine two or more buttons into a unified interface control element.

Toggle

Use the toggle button-group when only one button should be selected at a time. This is akin to a radio-button interaction.

Basic example

Hover
Focus
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--79763" role="button" aria-pressed="false">
        <input id="luci-button--79763" type="radio" class="luci-button__input" name="basic-toggle">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Left </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--51632" role="button" aria-pressed="false">
        <input id="luci-button--51632" type="radio" class="luci-button__input" name="basic-toggle">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Middle </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--97112" role="button" aria-pressed="false">
        <input id="luci-button--97112" type="radio" class="luci-button__input" name="basic-toggle">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Right </span>
        </span>
    </label>
</div>
Checked
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--62455" role="button" aria-pressed="false">
        <input id="luci-button--62455" type="radio" class="luci-button__input" name="basic-toggle-checked">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Left </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--84698" role="button" aria-pressed="true">
        <input id="luci-button--84698" type="radio" class="luci-button__input" name="basic-toggle-checked" checked>
        <span class="luci-button__inner">
            <span class="luci-button__text"> Middle </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--77808" role="button" aria-pressed="false">
        <input id="luci-button--77808" type="radio" class="luci-button__input" name="basic-toggle-checked">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Right </span>
        </span>
    </label>
</div>

Icon and label example

Icons can precede labels within button groups to provide additional context about the button's function.

Hover
Focus
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--649" role="button" aria-pressed="false">
        <input id="luci-button--649" type="radio" class="luci-button__input" name="icon-toggle-with-text">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
            <span class="luci-button__text"> Delete </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--8201" role="button" aria-pressed="false">
        <input id="luci-button--8201" type="radio" class="luci-button__input" name="icon-toggle-with-text">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
            <span class="luci-button__text"> Download </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--19321" role="button" aria-pressed="false">
        <input id="luci-button--19321" type="radio" class="luci-button__input" name="icon-toggle-with-text">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
            <span class="luci-button__text"> Help </span>
        </span>
    </label>
</div>
Checked
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--78581" role="button" aria-pressed="false">
        <input id="luci-button--78581" type="radio" class="luci-button__input" name="icon-toggle-with-text-checked">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
            <span class="luci-button__text"> Delete </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--20689" role="button" aria-pressed="true">
        <input id="luci-button--20689" type="radio" class="luci-button__input" name="icon-toggle-with-text-checked" checked>
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
            <span class="luci-button__text"> Download </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--76343" role="button" aria-pressed="false">
        <input id="luci-button--76343" type="radio" class="luci-button__input" name="icon-toggle-with-text-checked">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
            <span class="luci-button__text"> Help </span>
        </span>
    </label>
</div>

Icon-only

Use the icon-only button group when space is constrained and the intent of the icon is well understood.

Hover
Focus
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--68919" role="button" aria-pressed="false">
        <input id="luci-button--68919" type="radio" class="luci-button__input" name="icon-toggle">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--62248" role="button" aria-pressed="false">
        <input id="luci-button--62248" type="radio" class="luci-button__input" name="icon-toggle">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--14041" role="button" aria-pressed="false">
        <input id="luci-button--14041" type="radio" class="luci-button__input" name="icon-toggle">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
        </span>
    </label>
</div>
Checked
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--31190" role="button" aria-pressed="false">
        <input id="luci-button--31190" type="radio" class="luci-button__input" name="icon-toggle-checked">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--31500" role="button" aria-pressed="true">
        <input id="luci-button--31500" type="radio" class="luci-button__input" name="icon-toggle-checked" checked>
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--36865" role="button" aria-pressed="false">
        <input id="luci-button--36865" type="radio" class="luci-button__input" name="icon-toggle-checked">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
        </span>
    </label>
</div>

Multi-Select

Use the multi-select button group when multiple buttons can be selected at a time. This is similar to behavior when interacting with a checkbox.

Basic example

Hover
Focus
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--37182" role="button" aria-pressed="false">
        <input id="luci-button--37182" type="checkbox" class="luci-button__input" name="basic-multi-select">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Left </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--51840" role="button" aria-pressed="false">
        <input id="luci-button--51840" type="checkbox" class="luci-button__input" name="basic-multi-select">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Middle </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--61447" role="button" aria-pressed="false">
        <input id="luci-button--61447" type="checkbox" class="luci-button__input" name="basic-multi-select">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Right </span>
        </span>
    </label>
</div>
Checked
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--98059" role="button" aria-pressed="true">
        <input id="luci-button--98059" type="checkbox" class="luci-button__input" name="basic-multi-select-checked" checked>
        <span class="luci-button__inner">
            <span class="luci-button__text"> Left </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--59360" role="button" aria-pressed="false">
        <input id="luci-button--59360" type="checkbox" class="luci-button__input" name="basic-multi-select-checked">
        <span class="luci-button__inner">
            <span class="luci-button__text"> Middle </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input" for="luci-button--84227" role="button" aria-pressed="true">
        <input id="luci-button--84227" type="checkbox" class="luci-button__input" name="basic-multi-select-checked" checked>
        <span class="luci-button__inner">
            <span class="luci-button__text"> Right </span>
        </span>
    </label>
</div>

Icon and label example

Hover
Focus
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--77974" role="button" aria-pressed="false">
        <input id="luci-button--77974" type="checkbox" class="luci-button__input" name="icon-multi-select-with-text">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
            <span class="luci-button__text"> Delete </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--5676" role="button" aria-pressed="false">
        <input id="luci-button--5676" type="checkbox" class="luci-button__input" name="icon-multi-select-with-text">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
            <span class="luci-button__text"> Download </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--56859" role="button" aria-pressed="false">
        <input id="luci-button--56859" type="checkbox" class="luci-button__input" name="icon-multi-select-with-text">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
            <span class="luci-button__text"> Help </span>
        </span>
    </label>
</div>
Checked
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--26320" role="button" aria-pressed="true">
        <input id="luci-button--26320" type="checkbox" class="luci-button__input" name="icon-multi-select-with-text-checked" checked>
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
            <span class="luci-button__text"> Delete </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--43934" role="button" aria-pressed="false">
        <input id="luci-button--43934" type="checkbox" class="luci-button__input" name="icon-multi-select-with-text-checked">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
            <span class="luci-button__text"> Download </span>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--input luci-button--with-icons" for="luci-button--81496" role="button" aria-pressed="true">
        <input id="luci-button--81496" type="checkbox" class="luci-button__input" name="icon-multi-select-with-text-checked" checked>
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
            <span class="luci-button__text"> Help </span>
        </span>
    </label>
</div>

Icon-Only example

Hover
Focus
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--30293" role="button" aria-pressed="false">
        <input id="luci-button--30293" type="checkbox" class="luci-button__input" name="icon-multi-select">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--77212" role="button" aria-pressed="false">
        <input id="luci-button--77212" type="checkbox" class="luci-button__input" name="icon-multi-select">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--56272" role="button" aria-pressed="false">
        <input id="luci-button--56272" type="checkbox" class="luci-button__input" name="icon-multi-select">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
        </span>
    </label>
</div>
Checked
Copied to clipboard
<div class="luci-button-group">
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--17388" role="button" aria-pressed="true">
        <input id="luci-button--17388" type="checkbox" class="luci-button__input" name="icon-multi-select-checked" checked>
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#delete"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--2812" role="button" aria-pressed="false">
        <input id="luci-button--2812" type="checkbox" class="luci-button__input" name="icon-multi-select-checked">
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#download"> </use>
            </svg>
        </span>
    </label>
    <label class="luci-button luci-button--secondary luci-button--small luci-button--icon-only luci-button--input" for="luci-button--35711" role="button" aria-pressed="true">
        <input id="luci-button--35711" type="checkbox" class="luci-button__input" name="icon-multi-select-checked" checked>
        <span class="luci-button__inner">
            <svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
                <use xlink:href="/icons/luci.svg#help"> </use>
            </svg>
        </span>
    </label>
</div>

Accessibility

  • Include a role="button" attribute when using <input type="radio"> or <input type="checkbox"> buttons.
    • Add aria-pressed="true" when the button is :checked and aria-pressed="false" when it is not :checked.