Buttons
Last modified by Thiago Krieck on 2026/11/18 14:13
The standard
- Emphasis: Each screen or dialog should have a single primary button (btn btn-primary), for the action the user most likely came to do. Every other action should use the default style (btn btn-default), so that the main action stands out.
- Destructive actions: The button that confirms a destructive action should use the danger style (btn btn-danger) and be labelled with the action, such as Delete. It should never be labelled Yes or OK, so that users know exactly what they are confirming.
- Labels: Should be verbs, since they convey what the button does: Save, Delete, Create user. See Action labels.
- Element: Actions should use a <button> with an explicit type="button" or type="submit". A link styled as a button (<a class="btn">) should only be used for navigation, such as a Cancel that leaves the page.
- Icon-only buttons: Should have a tooltip and a text label for screen readers (sr-only), so that every user can tell what they do.
Reference example: the page edit form. Save & View is its only primary button, Save, Preview and Cancel use the default style, and each button shows its keyboard shortcut in its tooltip.

Buttons: the page edit form, with Save & View as the only primary button
Notes
- The automated accessibility checks only warn about target size and contrast, so these problems won't fail a build. They should be checked by hand. See Accessibility.
More
- Related: Delete confirmation, Modal, Menus and dropdowns