Components (2): Buttons / Button group
button.btn.btn-(primary|secondary|success|danger|warning|info|light|dark|link)
a.btn.btn-primary
Attributes
href="#"
role="button"
Link
button.btn.btn-primary
Attribute
type="submit"
Button
input.btn.btn-primary
Attributes
type="button"
value="Input"
input.btn.btn-primary
Attributes
type="submit"`
value="Submit"
input.btn.btn-primary
Attributes
type="reset"`
value="Reset"
button.btn.btn-outline-(primary|secondary|success|danger|warning|info|light|dark)
(button|...).btn.btn-(lg|sm)
Large .btn-lg
Medium (default)
Small .btn-sm
Add .btn-block
Setting .active
displays buttons with always active (pressed) state.
button
disabled
(acts on both display and action).disabled
(grayed display only)a
.disabled
(acts on both display and action)aria-disabled="true"
disabled
to button
(disables both display and action).disabled
to button
(can be still pressed).disabled
to a
(disables both display and action)div.btn-group
Attributes
role="group"
aria-label="Basic example"
button.btn.btn-(primary|secondary|...)
Attribute
type="button"
Left
A button toolbar is used to gather button groups, input groups, form controls, etc.
div.btn-toolbar
Attributes
role="toolbar"
aria-label="Toolbar with button groups"
div.btn-group
Basic example of a button toolbar
Examples using input groups with alignment options
div.btn-toolbar
div.btn-toolbar.justify-content-between
(⇒ Flex utilities )
Example using radios: (see Chexboxes and radios - Inline )
Radios are wrapped by div.form.form-inline
and justified with .mx-auto
Set .btn-group-(lg|sm)
div.btn-group.btn-group-lg
div.btn-group
div.btn-group.btn-group-sm
Dropdowns can be used with nesting button groups.
div.btn-group
button.btn.btn-secondary
div.btn-group
button.btn.btn-secondary.dropdown-toggle
div.dropdown-menu
a.dropdown-item
div.btn-group-vertical
Vertival example with dropdowns (see source for detail)