Buttons
Buttons are interactive elements activated by a user with a mouse, keyboard, or tap. Once activated, it then performs a programmable action, such as submitting a form or opening a dialog.
Variations
Primary buttons
Copy as:
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
Secondary buttons
Copy as:
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
Rounded Full Primary Buttons
Copy as:
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
Rounded Full Secondary Buttons
Copy as:
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
Outline Buttons
Copy as:
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
Link Buttons
Copy as:
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
App Buttons
Copy as:
Get it onApp Storecopydone
Get it onGoogle Playcopydone
App Storecopydone
Google Playcopydone
Get it onApp Storecopydone
Get it onGoogle Playcopydone
App Storecopydone
Google Playcopydone
Get it onApp Storecopydone
Get it onGoogle Playcopydone
App Storecopydone
Google Playcopydone
Usage
Buttons communicate actions that users can take. They are typically placed throughout your UI, in places like:
- Dialogs
- Modal windows
- Forms
- Cards
- Toolbars
Specs
Buttons come in 6 styles (primary, secondary, primary rounded, secondary rounded, outline and link) They can contain text, leading or trailing icons and even a notification badge. All variations come in 3 sizes:
- Small: 2em height (32px), 1rem (16px) horizontal padding and 0.75rem (12px) font size. Icons on small buttons are 1rem (16px) wide and tall and have a 0.5rem (8px) distance from the text.
- Base: 2.5em height (40px), 1.25rem (20px) horizontal padding and 0.875rem (14px) font size. Icons on base buttons are 1.25rem (20px) wide and tall and have a 0.5rem (8px) distance from the text.
- Large: 3em height (48px), 1.5rem (24px) horizontal padding and 0.875rem (14px) font size. Icons on large buttons are 1.25rem (20px) wide and tall and have a 0.5rem (8px) distance from the text.
Accessibility notes
- A
<button>
tag does not need anything special to work. Use<button>
when you can, but it is possible to use other elements (such as a link) as long as you add role="button" - In the case of icon-only buttons include a span with className=“sr-only" from screen readers and hence give more context to the button's purpose.
- If it contains an icon, use aria-label to describe the icon.
- If a link is used instead of a button element include a
role="button"
role.