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--54690" role="button" aria-pressed="false">
        <input id="luci-button--54690" 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--65692" role="button" aria-pressed="false">
        <input id="luci-button--65692" 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--27245" role="button" aria-pressed="false">
        <input id="luci-button--27245" 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--19244" role="button" aria-pressed="false">
        <input id="luci-button--19244" 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--40176" role="button" aria-pressed="true">
        <input id="luci-button--40176" 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--46206" role="button" aria-pressed="false">
        <input id="luci-button--46206" 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--31490" role="button" aria-pressed="false">
        <input id="luci-button--31490" 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--32044" role="button" aria-pressed="false">
        <input id="luci-button--32044" 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--53538" role="button" aria-pressed="false">
        <input id="luci-button--53538" 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--44206" role="button" aria-pressed="false">
        <input id="luci-button--44206" 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--61953" role="button" aria-pressed="true">
        <input id="luci-button--61953" 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--58492" role="button" aria-pressed="false">
        <input id="luci-button--58492" 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--24205" role="button" aria-pressed="false">
        <input id="luci-button--24205" 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--12282" role="button" aria-pressed="false">
        <input id="luci-button--12282" 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--34028" role="button" aria-pressed="false">
        <input id="luci-button--34028" 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--17402" role="button" aria-pressed="false">
        <input id="luci-button--17402" 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--54122" role="button" aria-pressed="true">
        <input id="luci-button--54122" 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--72700" role="button" aria-pressed="false">
        <input id="luci-button--72700" 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--85035" role="button" aria-pressed="false">
        <input id="luci-button--85035" 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--93764" role="button" aria-pressed="false">
        <input id="luci-button--93764" 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--26048" role="button" aria-pressed="false">
        <input id="luci-button--26048" 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--83057" role="button" aria-pressed="true">
        <input id="luci-button--83057" 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--3051" role="button" aria-pressed="false">
        <input id="luci-button--3051" 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--70020" role="button" aria-pressed="true">
        <input id="luci-button--70020" 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--95527" role="button" aria-pressed="false">
        <input id="luci-button--95527" 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--60097" role="button" aria-pressed="false">
        <input id="luci-button--60097" 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--48612" role="button" aria-pressed="false">
        <input id="luci-button--48612" 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--57842" role="button" aria-pressed="true">
        <input id="luci-button--57842" 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--2375" role="button" aria-pressed="false">
        <input id="luci-button--2375" 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--44082" role="button" aria-pressed="true">
        <input id="luci-button--44082" 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--99047" role="button" aria-pressed="false">
        <input id="luci-button--99047" 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--19445" role="button" aria-pressed="false">
        <input id="luci-button--19445" 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--42352" role="button" aria-pressed="false">
        <input id="luci-button--42352" 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--41323" role="button" aria-pressed="true">
        <input id="luci-button--41323" 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--94601" role="button" aria-pressed="false">
        <input id="luci-button--94601" 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--29471" role="button" aria-pressed="true">
        <input id="luci-button--29471" 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.