Button vs. link
The HTML elements for buttons and links describe a very specific type of action that is going to be taken when they are used. However, it is important to know when to use one or the other in a specific situation:
- Use links for navigating to other pages.
- Use buttons for performing an action, such as: “submit,” “merge,” “create new,” “upload,” etc. These actions almost always occur on the same page.
A default button is the standard button with basic style and the most commonly used option.
Use the inverse button when you want to place a default button on a dark background.
A primary button is used for primary actions that are clearly more important and need attention drawn to it.
The outlined version is the alternative to solid primary buttons. Use these buttons when actions are primary but don’t want to give extra visual weight.
Use the danger button to indicate destructive or negative actions. For example, deleting data.
How to chose the right button class
- In a UI with several buttons such as "copy", "paste", "crop", etc,
since all those buttons have the same hierarchy, they should be using the
- If one of the buttons represents a call-to-action (ie "save system")
where the intention is that the user saves certain information,
the button class should be
btn-primarysince we want the user to focus on it.
- In a scenario where a user clicks on a button using the
btn-defaultclass which triggers a destructive action (ie "delete"), the user will be required to confirm the deletion:
Deleting this system cannot be reversed and all information will be lost
- Even though it was the user's choice to use "delete", mistakes can
happen and users don't always read the labels in buttons.
This is why the
btn-dangerclass in the button helps the user to focus on the destructive action.
btn-danger. The use of other Bootstrap button styles such as