Buttons should be used to imply specific actions on a web page and may be created using a variety of sizes, types and variations. Things to consider:
- Each button should contain a label and/or icon.
- When creating a button label, try to describe the action in as few of words as possible.
- Use title case, but avoid full sentences, and where applicable, try to begin each label with a verb. (i.e. Submit a Claim, Get a Quote).
- Additionally, ensure that the label fits on a single line, from mobile to desktop.
Adding a Button to the Page
A button may be implemented in one of two ways—using the <a>
or <button>
tags.
When linking to another page, please use the <a>
element.
<a href="gohere.html" class="button">button name</a>
But, if your button is triggering an action on the page, such as submitting a form or starting a JavaScript event, then use the <button>
element.
<button type="submit" class="button">button name</button>
Each button may also contain the following three classes...
.button--*type (to correctly style the button) *Not adding this class will result in the default button type.
.button--*size (to apply the appropriate button size) *Not adding this class will result in the default button size.
...and should be constructed as shown:
<button class="button [button--type] [button--size]"></button>
For more information on available button types and sizing, refer to the examples below.