Use this component when the button should trigger a change to the current page. For example,
a hamburger menu and FAQ element all result in clickable actions and should use the button
tag.
Requirements
_cmp.button.scss
button.js
<button class="cmp-button">Button Text</button>
Use this component when a user is navigating to a separate page. For example, a button within a
CTA element that takes the user to the contact page should use the a
tag.
Requirements
_cmp.button.scss
<a class="cmp-button" href="#">Button Text</a>
Enhancements
aria-label
to indicate that to the user<a class="cmp-button" href="#" aria-label="Button Text external link">Button Text</a>
Use this component when the button should trigger a state change. For example,
a switch between light and dark mode. While it may be tempting to use a checkbox
,
it may not be the most semantic solution. Checkboxes relate to collecting information, as in a form.
Requirements
Notes
_cmp.toggle-button.scss
toggle-button.js
<button class="cmp-button cmp-button--toggle" aria-pressed="false">Toggle</button>