From c720d951be4481dab684955b7ef1a4ebb03ed0cf Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 10 Feb 2012 23:50:45 -0800 Subject: add best practices and re-org the button groups --- docs/components.html | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'docs/components.html') diff --git a/docs/components.html b/docs/components.html index 2a31528ea..cb41c736e 100644 --- a/docs/components.html +++ b/docs/components.html @@ -118,14 +118,34 @@

Button groups

Use button groups to join multiple buttons together as one composite component. Build them with a series of <a> or <button> elements.

-

You can also combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex projects.

-
-
+

Best practices

+

We recommend the following guidelines for using button groups and toolbars:

+
    +
  • Always use the same element in a single button group, <a> or <button>.
  • +
  • Don't mix buttons of different colors in the same button group.
  • +
  • Use icons in addition to or instead of text, but be sure include alt and title text where appropriate.
  • +
+

Related Button groups with dropdowns (see below) should be called out separately and always include a dropdown caret to indicate intended behavior.

+
+
+

Default example

+

Here's how the HTML looks for a standard button group built with anchor tag buttons:

+
+
+
+<div class="btn-group">
+  <a class="btn" href="#">1</a>
+  <a class="btn" href="#">2</a>
+  <a class="btn" href="#">3</a>
+</div>
+
+

Toolbar example

+

Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.

1 @@ -142,18 +162,6 @@ 8
-
-
-

Example markup

-

Here's how the HTML looks for a standard button group built with anchor tag buttons:

-
-<div class="btn-group">
-  <a class="btn" href="#">1</a>
-  <a class="btn" href="#">2</a>
-  <a class="btn" href="#">3</a>
-</div>
-
-

And with a toolbar for multiple groups:

 <div class="btn-toolbar">
   <div class="btn-group">
-- 
cgit v1.2.3