4. Action Buttons
Action buttons are the workhorses of user interfaces, enabling users to perform specific tasks or initiate processes. This chapter covers the main types of action buttons and best practices for their implementation.
Primary, Secondary, and Tertiary Buttons
A clear hierarchy of buttons helps users understand the importance and impact of different actions.
- Primary Buttons: Used for the most important or frequently used action on a page.
- Secondary Buttons: For alternative or less important actions.
- Tertiary Buttons: For the least important or least used actions.
Best practices:
- Use color, size, and placement to differentiate between button types
- Limit the number of primary buttons on a page (ideally one)
- Ensure sufficient contrast between button types
Example CSS for button hierarchy:
.btn-primary {
background-color: #3498db;
color: white;
}
.btn-secondary {
background-color: #2ecc71;
color: white;
}
.btn-tertiary {
background-color: #95a5a6;
color: white;
}