aboutsummaryrefslogtreecommitdiff
path: root/docs/components/button-group.md
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-05-26 22:28:09 -0700
committerMark Otto <[email protected]>2017-05-26 22:28:09 -0700
commit6c3f833076a9fa68601741e3e21bd07ad79b7d8a (patch)
treefe016946d77f9ffff15bbe9cdc593fd098b5bcc7 /docs/components/button-group.md
parentc581564a780974c6430ac5897740006f623f2277 (diff)
parent5d7db507396275fcda96935aff47b09e1d79ddc1 (diff)
downloadbootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.tar.xz
bootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.zip
Merge branch 'v4-docs-streamlined' of https://github.com/twbs/bootstrap into v4-docs-streamlined
Diffstat (limited to 'docs/components/button-group.md')
-rw-r--r--docs/components/button-group.md48
1 files changed, 45 insertions, 3 deletions
diff --git a/docs/components/button-group.md b/docs/components/button-group.md
index cff38e1b1..59a18e262 100644
--- a/docs/components/button-group.md
+++ b/docs/components/button-group.md
@@ -26,17 +26,17 @@ Wrap a series of buttons with `.btn` in `.btn-group`.
## Button toolbar
-Combine sets of button groups into button toolbars for more complex components.
+Combine sets of button groups into button toolbars for more complex components. Use utility classes as needed to space out groups, buttons, and more.
{% example html %}
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
- <div class="btn-group" role="group" aria-label="First group">
+ <div class="btn-group mr-2" role="group" aria-label="First group">
<button type="button" class="btn btn-secondary">1</button>
<button type="button" class="btn btn-secondary">2</button>
<button type="button" class="btn btn-secondary">3</button>
<button type="button" class="btn btn-secondary">4</button>
</div>
- <div class="btn-group" role="group" aria-label="Second group">
+ <div class="btn-group mr-2" role="group" aria-label="Second group">
<button type="button" class="btn btn-secondary">5</button>
<button type="button" class="btn btn-secondary">6</button>
<button type="button" class="btn btn-secondary">7</button>
@@ -47,6 +47,36 @@ Combine sets of button groups into button toolbars for more complex components.
</div>
{% endexample %}
+Feel free to mix input groups with button groups in your toolbars. Similar to the example above, you'll likely need some utilities though to space things properly.
+
+{% example html %}
+<div class="btn-toolbar mb-3" role="toolbar" aria-label="Toolbar with button groups">
+ <div class="btn-group mr-2" role="group" aria-label="First group">
+ <button type="button" class="btn btn-secondary">1</button>
+ <button type="button" class="btn btn-secondary">2</button>
+ <button type="button" class="btn btn-secondary">3</button>
+ <button type="button" class="btn btn-secondary">4</button>
+ </div>
+ <div class="input-group">
+ <span class="input-group-addon" id="btnGroupAddon">@</span>
+ <input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon">
+ </div>
+</div>
+
+<div class="btn-toolbar justify-content-between" role="toolbar" aria-label="Toolbar with button groups">
+ <div class="btn-group" role="group" aria-label="First group">
+ <button type="button" class="btn btn-secondary">1</button>
+ <button type="button" class="btn btn-secondary">2</button>
+ <button type="button" class="btn btn-secondary">3</button>
+ <button type="button" class="btn btn-secondary">4</button>
+ </div>
+ <div class="input-group">
+ <span class="input-group-addon" id="btnGroupAddon2">@</span>
+ <input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon2">
+ </div>
+</div>
+{% endexample %}
+
## Sizing
Instead of applying button sizing classes to every button in a group, just add `.btn-group-*` to each `.btn-group`, including each one when nesting multiple groups.
@@ -106,6 +136,18 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
<button type="button" class="btn btn-secondary">Button</button>
<button type="button" class="btn btn-secondary">Button</button>
+ <button type="button" class="btn btn-secondary">Button</button>
+ <button type="button" class="btn btn-secondary">Button</button>
+ <button type="button" class="btn btn-secondary">Button</button>
+ <button type="button" class="btn btn-secondary">Button</button>
+ </div>
+</div>
+
+
+<div class="bd-example">
+ <div class="btn-group-vertical" role="group" aria-label="Vertical button group">
+ <button type="button" class="btn btn-secondary">Button</button>
+ <button type="button" class="btn btn-secondary">Button</button>
<div class="btn-group" role="group">
<button id="btnGroupVerticalDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown