Button Groups

Button groups are a collection of buttons. This component is used in our questions view, and is frequently used in conjunction with other form elements such as search fields and sorting dropdowns. If the content you’re interacting with is a simple paring down or filter of the current view, it’s appropriate to use the .s-btn-group component. Add the class .is-selected to show the currently-selected button.

Classes

Class Applied to Description
.s-button-group N/A Base button group style.
.s-button-group--container form When required to wrap one of our buttons within a button group in a form, apply this class to the form to maintain the intended visuals.

Example

1
2
3
4
5
6
7
8
9
10
11
<div class="s-btn-group">
    <button class="s-btn s-btn__muted s-btn__outlined" role="button">Newest</button>
    <form class="s-btn-group--container">
        <button class="s-btn s-btn__muted s-btn__outlined" role="button">Frequent</button>
    </form>
    <button class="s-btn s-btn__muted s-btn__outlined is-selected" role="button">Votes</button>
    <button class="s-btn s-btn__muted s-btn__outlined" role="button">Active</button>
    <form class="s-btn-group--container">
        <button class="s-btn s-btn__muted s-btn__outlined" role="button">Unanswered</button>
    </form>
</div>