Buttons invite and trigger key actions throughout the experience.
Use for the highest-priority actions.
<button class="spirit-button"> Donate </button>
<button class="spirit-button" disabled> Donate </button>
<div class="spirit-container spirit-container--dark">
<button class="spirit-button"> Donate </button>
</div>
Use for non-critical actions.
<button class="spirit-button spirit-button--secondary"> Cancel </button>
<button class="spirit-button spirit-button--secondary" disabled> Cancel </button>
Do not use secondary button on dark. Situations using dark background should be simple enough to rely on a single primary button. For tertiary actions on dark, use minimal button.
Use for tertiary actions.
<button class="spirit-button spirit-button--minimal"> Details </button>
<button class="spirit-button spirit-button--minimal" disabled> Details </button>
Use instead of secondary button on dark.
<div class="spirit-container spirit-container--dark">
<button class="spirit-button spirit-button--minimal"> Details </button>
</div>
Use where an action can be fully represented by an icon and a label don’t fit comfortably alongside that icon.
<button class="spirit-button spirit-button--icon-only spirit-button--focus spirit-button--is-icon">
<svg aria-label="chevron-right" class="spirit-icon spirit-icon--chevron-right">
<use xlink:href="/icons/spirit.svg#chevron-right">
<title>chevron-right</title>
</use>
</svg>
</button>
<div class="spirit-container spirit-container--dark">
<button class="spirit-button spirit-button--icon-only spirit-button--is-icon">
<svg aria-label="chevron-right" class="spirit-icon spirit-icon--chevron-right">
<use xlink:href="/icons/spirit.svg#chevron-right">
<title>chevron-right</title>
</use>
</svg>
</button>
</div>
Use status buttons for key interactions where detailed state feedback is desirable.
Use when an action isn’t instant and thus acts as a loader or progress indicator.
<button class="spirit-button" data-loader=true>
<span class="spirit-button__icon-contain" data-icon="spinner" aria-hidden="true">
<svg aria-label="Loading" role="img" class="spirit-icon--spinner" viewBox="25 25 50 50" xmlns="http://www.w3.org/2000/svg">
<circle class="spirit-icon--spinner__path" cx="50" cy="50" r="20" stroke-width="4" stroke-miterlimit="10" />
</svg>
</span>
<span class="spirit-button__icon-contain" data-icon="success" aria-hidden="true">
<svg aria-label="Success" class="spirit-icon spirit-icon--check">
<use xlink:href="/icons/spirit.svg#check">
<title>Success</title>
</use>
</svg>
</span>
<span class="spirit-button__default-text" aria-hidden="false"> Submit Donation </span>
</button>
<button class="spirit-button spirit-button--loading" data-loader=true>
<span class="spirit-button__icon-contain" data-icon="spinner" aria-hidden="false">
<svg aria-label="Loading" role="img" class="spirit-icon--spinner" viewBox="25 25 50 50" xmlns="http://www.w3.org/2000/svg">
<circle class="spirit-icon--spinner__path" cx="50" cy="50" r="20" stroke-width="4" stroke-miterlimit="10" />
</svg>
</span>
<span class="spirit-button__icon-contain" data-icon="success" aria-hidden="true">
<svg aria-label="Success" class="spirit-icon spirit-icon--check">
<use xlink:href="/icons/spirit.svg#check">
<title>Success</title>
</use>
</svg>
</span>
<span class="spirit-button__default-text" aria-hidden="true"> Submit Donation </span>
</button>
<button class="spirit-button" data-loader=true data-type=true>
<span class="spirit-button__icon-contain" data-icon="spinner" aria-hidden="true">
<svg aria-label="Loading" role="img" class="spirit-icon--spinner" viewBox="25 25 50 50" xmlns="http://www.w3.org/2000/svg">
<circle class="spirit-icon--spinner__path" cx="50" cy="50" r="20" stroke-width="4" stroke-miterlimit="10" />
</svg>
</span>
<span class="spirit-button__icon-contain" data-icon="success" aria-hidden="false">
<svg aria-label="Success" class="spirit-icon spirit-icon--check">
<use xlink:href="/icons/spirit.svg#check">
<title>Success</title>
</use>
</svg>
</span>
<span class="spirit-button__default-text" aria-hidden="true"> Submit Donation </span>
</button>
Use feedback colors to communicate success or danger on a primary button.
<button class="spirit-button spirit-button--success"> Success </button>
<button class="spirit-button spirit-button--danger"> Delete </button>
<button class="spirit-button spirit-button--success spirit-button--is-icon">
<svg aria-label="Success" class="spirit-icon spirit-icon--check">
<use xlink:href="/icons/spirit.svg#check">
<title>Success</title>
</use>
</svg>
</button>
Use in place of a radio group or checkboxes to capture a key user selection.
<div class="spirit-button spirit-button--toggle">
<input class="spirit-button__input spirit-button__checkbox" type=checkbox name=checkbox id=option1 value=10 tabindex="-1" />
<label for=option1 class="spirit-button__inner" tabindex="0"> $10 </label>
</div>
<div class="spirit-button spirit-button--toggle spirit-button--disabled">
<input class="spirit-button__input spirit-button__checkbox" type=checkbox name=checkbox id=option5 value=10 tabindex="-1" />
<label for=option5 class="spirit-button__inner" tabindex="0"> $10 </label>
</div>
<div class="spirit-button spirit-button--toggle">
<input class="spirit-button__input spirit-button__radio" type=radio name=radiogroup id=radio-option1 value=250 tabindex="-1" />
<label for=radio-option1 class="spirit-button__inner" tabindex="0"> $250 </label>
</div>
<div class="spirit-button spirit-button--toggle">
<input class="spirit-button__input spirit-button__radio" type=radio name=radiogroup id=radio-option2 value=120 tabindex="-1" />
<label for=radio-option2 class="spirit-button__inner" tabindex="0"> $120 </label>
</div>
<div class="spirit-button spirit-button--toggle">
<input class="spirit-button__input spirit-button__radio" type=radio name=radiogroup id=radio-option3 value=60 tabindex="-1" />
<label for=radio-option3 class="spirit-button__inner" tabindex="0"> $60 </label>
</div>
<div class="spirit-button spirit-button--toggle">
<input class="spirit-button__input spirit-button__radio" type=radio name=radiogroup id=radio-option4 value=30 tabindex="-1" />
<label for=radio-option4 class="spirit-button__inner" tabindex="0"> $30 </label>
</div>
Scale buttons according to visual priority and available real estate. Text and icons scale with the overall button and are not independently configurable.
The medium default size can be modified with .spirit-button--extra-small
, .spirit-button--small
, and .spirit-button--large
. Icon only buttons are only available in small and default.
Buttons can be sized responsively. By default, buttons stay the same size on all viewports. By adding breakpoint-specific classes, a button can have different sizes for small, medium, and large viewports.
A class of: .spirit-button--extra-small-lg
Would result in an extra small button at the largest viewport breakpoint.
Class | Applies to | Outcome |
---|---|---|
|
|
Default syntax for button sizing which works at all sizes. If defining multiple responsive sizes, this is the baseline for small viewports, “mobile first”. |
|
|
Applies the |
|
|
Applies the |
aria-label
attribute on the SVG within an icon only button. See icons for additional guidance. Where feasible, use <button>
. For applications that generate markup beyond your control, using <input type=”submit”>
is also acceptable.
Class | Applies to | Outcome |
---|---|---|
|
|
Applies secondary button style |
|
|
Applies minimal button style |
|
|
Applies icon only button style, which includes conversion to a round shape. |
|
|
Use in place of a standard radio/checkbox group. See Toggle Button for specific implementation details on this custom component. |
|
|
Applies button size styles. Use |
Buttons can be sized responsively. See Responsive Sizing.