|
@@ -8,7 +8,7 @@ bootstrapLink: components/buttons/
|
|
|
|
|
|
As one of the most common elements of UI design, buttons have a very important function of engaging users with your website or app and guiding them in their actions. Use the `.btn` classes with the `<button>` element and add additional styling that will make your buttons serve their purpose and draw users' attention.
|
|
|
|
|
|
-```html example code centered separated height="7rem"
|
|
|
+```html example centered separated height="7rem"
|
|
|
<a href="#" class="btn" role="button">Link</a>
|
|
|
<button class="btn">Button</button>
|
|
|
<input type="button" class="btn" value="Input" />
|
|
@@ -20,7 +20,7 @@ As one of the most common elements of UI design, buttons have a very important f
|
|
|
|
|
|
The standard button creates a white background and subtle hover animation. It's meant to look and behave as an interactive element of your page.
|
|
|
|
|
|
-```html example code centered separated height="7rem"
|
|
|
+```html example centered separated height="7rem"
|
|
|
<a href="#" class="btn" role="button">Link</a>
|
|
|
```
|
|
|
|
|
@@ -28,7 +28,7 @@ The standard button creates a white background and subtle hover animation. It's
|
|
|
|
|
|
Use the button classes that correspond to the function of your button. The big range of available colors will help you show your buttons' purpose and make them easy to spot.
|
|
|
|
|
|
-```html code example vertical centered separated scrollable height="15rem"
|
|
|
+```html example vertical centered separated scrollable height="15rem"
|
|
|
<a href="#" class="btn btn-primary">Primary</a>
|
|
|
<a href="#" class="btn btn-secondary">Secondary</a>
|
|
|
<a href="#" class="btn btn-success">Success</a>
|
|
@@ -43,7 +43,7 @@ Use the button classes that correspond to the function of your button. The big r
|
|
|
|
|
|
Make buttons look inactive to show that an action is possible once the user meets certain criteria, such as completing the required fields to submit a form.
|
|
|
|
|
|
-```html code example vertical centered separated scrollable height="15rem"
|
|
|
+```html example vertical centered separated scrollable height="15rem"
|
|
|
<a href="#" class="btn btn-primary disabled">Primary</a>
|
|
|
<a href="#" class="btn btn-secondary disabled">Secondary</a>
|
|
|
<a href="#" class="btn btn-success disabled">Success</a>
|
|
@@ -58,7 +58,7 @@ Make buttons look inactive to show that an action is possible once the user meet
|
|
|
|
|
|
Choose the right color for your button to make it go well with your design and draw users' attention. Button colors can have a big influence on users' decisions, which is why it's important to choose them based on the intended purpose.
|
|
|
|
|
|
-```html code example vertical centered separated scrollable height="15rem"
|
|
|
+```html example vertical centered separated scrollable height="15rem"
|
|
|
<a href="#" class="btn btn-blue">Blue</a>
|
|
|
<a href="#" class="btn btn-azure">Azure</a>
|
|
|
<a href="#" class="btn btn-indigo">Indigo</a>
|
|
@@ -173,12 +173,12 @@ Replace the default modifier class with the `.btn-outline-*` class, if you want
|
|
|
|
|
|
Add `.btn-lg` or `.btn-sm` to change the size of your button and differentiate those which should have primary focus from those of secondary importance. Adapt the button size to your design and encourage users to take actions.
|
|
|
|
|
|
-```html code example centered separated height="8rem"
|
|
|
+```html example centered separated height="8rem"
|
|
|
<button type="button" class="btn btn-primary btn-lg">Large button</button>
|
|
|
<button type="button" class="btn btn-lg">Large button</button>
|
|
|
```
|
|
|
|
|
|
-```html code example centered separated height="7rem"
|
|
|
+```html example centered separated height="7rem"
|
|
|
<button type="button" class="btn btn-primary btn-sm">Small button</button>
|
|
|
<button type="button" class="btn btn-sm">Small button</button>
|
|
|
```
|
|
@@ -782,7 +782,7 @@ Add the `.btn-loading` class to show a button's loading state, which can be usef
|
|
|
|
|
|
Create a list of buttons using the `.btn-list` container to display different actions a user can take. If you add aditional styling, such as colours, you will be able to focus users' attention on a particular action or suggest the result.
|
|
|
|
|
|
-```html code example vertical centered columns={3} height="7rem"
|
|
|
+```html example vertical centered columns={3} height="7rem"
|
|
|
<div class="btn-list">
|
|
|
<a href="#" class="btn btn-success">Save changes</a>
|
|
|
<a href="#" class="btn">Save and continue</a>
|
|
@@ -792,7 +792,7 @@ Create a list of buttons using the `.btn-list` container to display different ac
|
|
|
|
|
|
If the list is long, it will be wrapped and some buttons will be moved to the next line, keeping them all evenly spaced.
|
|
|
|
|
|
-```html code example centered
|
|
|
+```html example centered
|
|
|
<div class="btn-list">
|
|
|
<a href="#" class="btn">One</a>
|
|
|
<a href="#" class="btn">Two</a>
|
|
@@ -818,21 +818,21 @@ If the list is long, it will be wrapped and some buttons will be moved to the ne
|
|
|
|
|
|
Use the `.text-center` or the `.text-end` modifiers to change the buttons' alignment and place them where they suit best.
|
|
|
|
|
|
-```html code example vertical centered columns={3} height="7rem"
|
|
|
+```html example vertical centered columns={3} height="7rem"
|
|
|
<div class="btn-list justify-content-center">
|
|
|
<a href="#" class="btn">Save and continue</a>
|
|
|
<a href="#" class="btn btn-primary">Save changes</a>
|
|
|
</div>
|
|
|
```
|
|
|
|
|
|
-```html code example vertical centered columns={3} height="7rem"
|
|
|
+```html example vertical centered columns={3} height="7rem"
|
|
|
<div class="btn-list justify-content-end">
|
|
|
<a href="#" class="btn">Save and continue</a>
|
|
|
<a href="#" class="btn btn-primary">Save changes</a>
|
|
|
</div>
|
|
|
```
|
|
|
|
|
|
-```html code example vertical centered columns={3} height="7rem"
|
|
|
+```html example vertical centered columns={3} height="7rem"
|
|
|
<div class="btn-list">
|
|
|
<a href="#" class="btn btn-outline-danger me-auto">Delete</a>
|
|
|
<a href="#" class="btn">Save and continue</a>
|