The .button classes are designed to be used with the <button> element, but can also be used with <a> and <input> elements. When using button classes on <a> elements that trigger in-page functionality, use the role="button" attribute to convey their purpose to assistive technologies such as screen readers.
Usage
Solid buttons
Use .button with .button-primary to create a solid button, used to represent primary actions.
Button variants also exist for secondary and tertiary colors defined in theme settings, which you can apply using .button-secondary and .button-tertiary, respectively.
Outline buttons
Use .button-outline with .button to create an outline button, used to represent secondary actions.
Use .button-outline-primary to create an outline button with the theme’s primary color applied.
Link buttons
Use .button-link with .button to give buttons the appearance of links while aligning them with other buttons. These are typically used to represent less common actions.
Sizes
Use .button-lg to make a button larger and more prominent.
Use .button-sm to make a button smaller.
States
Active
Use .is-active to apply the styles associated with a button’s active state.
Disabled
Buttons will look inactive when the disabled boolean attribute is present on a button.
Disabled buttons using the <a> element must add the .is-disabled class and the aria-disabled="true" attribute should be added to communicate the state of the element to assistive technologies. The tabindex="-1" attribute will prevent them from receiving keyboard focus.
Variants
Use the solid-button and outline-button Sass mixins provided as part of our framework to create different colored buttons.
// A red solid button.button-red{@includesolid-button(#f01);}// A red outline button.button-outline-red{@includeoutline-button(#f01);}
You can use any color, not just those in the predefined theme color palette.
Questions or feedback about this article? Let us know
Verify purchase
Provide details about your purchase to unlock this and other code examples throughout the website.