Foundation Button Groups
Button group
Foundation can create a series of buttons on the same line.
You can use the element and add the .button-group class to create a button group:
Example
<
ul
class=
"button-group"
<
li
<
button
type=
"button"
class=
"button"
Apple
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Samsung
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Sony
<
/button
<
/li
<
/ulTry it »
Vertical button groups
Vertical button groups are created using the .stack class. Note that the buttons span the full width of the parent element:
Example
<
ul
class="button-group stack"
<
li
<
button
type=
"button"
class=
"button"
Apple
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Samsung
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Sony
<
/button
<
/li
<
/ulTry it »
.stack-for-small class is used for small screens, where buttons change from horizontal to vertical arrangement:
Example
<
ul
class="button-group stack-for-small"
<
li
<
button
type=
"button"
class=
"button"
Apple
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Samsung
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Sony
<
/button
<
/li
<
/ulTry it »
Rounded button groups
Within a button group, use the .radius and .round class to add rounded corners to the buttons:
Example
<
ul
class="button-group radius"
<
li
<
button
type=
"button"
class=
"button"
Apple
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Samsung
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Sony
<
/button
<
/li
<
/ul
<
ul
class="button-group round"
<
li
<
button
type=
"button"
class=
"button"
Apple
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Samsung
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Sony
<
/button
<
/li
<
/ulTry it »
Evenly stretched button groups
.even-num class is used to distribute the width of the buttons evenly in a button group and span 100% of the parent element's width.
num for the number of buttons in a button group, from 1 to 8:
Example
<
ul
class="button-group even-3"
<
li
<
button
type=
"button"
class=
"button"
Apple
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Samsung
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Sony
<
/button
<
/li
<
/ul
<
ul
class="button-group even-5"
<
li
<
button
type=
"button"
class=
"button"
Apple
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Samsung
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Sony
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
HTC
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
Huawei
<
/button
<
/li
<
/ul
<
ul
class="button-group even-8"
<
li
<
button
type=
"button"
class=
"button"
A
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
B
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
C
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
D
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
E
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
F
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
G
<
/button
<
/li
<
li
<
button
type=
"button"
class=
"button"
H
<
/button
<
/li
<
/ulTry it »
Dropdown menu buttons
A dropdown menu button lets the user select a predefined value:
Example
<
a
href=
"#"
data-dropdown=
"id01"
class="button dropdown"
Dropdown Button
<
/a
<
ul
id=
"id01"data-dropdown-content class=
"f-dropdown"
<
li
<
a
href=
"#"Link 1
<
/a
<
/li
<
li
<
a
href=
"#"Link 2
<
/a
<
/li
<
li
<
a
href=
"#"Link 3
<
/a
<
/li
<
/ul
<
script$(document).ready(function() {
$(document).foundation();
})
<
/script
Try it »
Example Parsing
.dropdown class creates a dropdown menu button.
Use the data-dropdown="id" attribute on a button or link to open the dropdown menu.
id The value must match the content of the dropdown menu (id01).
in Add to .f-dropdown class and data-dropdown-content attribute to create the content of the dropdown menu.
Finally, initialize Foundation JS.
Split button
We can also create a split button dropdown. Simply add the .split class to the button and use a span element to create an arrow button:
Example
<
button
class="button split"
Split Button
<
span
data-dropdown=
"id01"
<
/span
<
/button
<
ul
id=
"id01"data-dropdown-content class=
"f-dropdown"
<
li
<
a
href=
"#"Link 1
<
/a
<
/li
<
li
<
a
href=
"#"Link 2
<
/a
<
/li
<
li
<
a
href=
"#"Link 3
<
/a
<
/li
<
/ul
<
script$(document).ready(function() {
$(document).foundation();
})
<
/script
Try it »