Button Groups
View code
New in v3.6! The button groups from Blaze 2 CSS!
Use
As with all RiotGear2 tags you can use markdown in your button text!
Button Group Attributes
These are global settings for all the buttons in the group. The only exceptions arestyle
, disabled
& active
which can be set individually in the opts
settings.
style:
size: xsmall | small | medium | large | xlarge | super
ghost attribute: yes| no OR true | false |
rounded: yes | no OR true | false |
disbled attribute: yes| no OR true | false |
Button Attributes
These are global settings for all the buttons in the group. The only exception isstyle
& active
which can be set individually in the opts
settings.
style:
active attribute: yes | no OR true | false |
disbled attribute: yes | no OR true | false |
HTML
You can either pass the text content for the button within therg-button
tags, or via the text=""
attribute. The text within the tag is always used, if present.
<rg-button-group style="<empty>|brand|info|success|warning|error" [rounded=true] [ghost=true]></rg-button-group>
JavaScript
var tags = riot.mount ("div#grp-demo-1", "rg-button-group", {
group: {
style: "brand",
size: "small",
buttons: [
{text: "Button **1**", active: "yes"},
{text: "Button **2**"},
{text: "Button **3**"}
]
}
}) ;
riot.mount ("div#grp-demo-2", "rg-button-group", {
group: {
style: "warning",
rounded: true,
ghost: true,
size: "medium",
buttons: [
{text: "Group **1**"},
{text: "Group **2**", active: "yes"},
{text: "Group **3**"}
]
}
}) ;
riot.mount ("div#grp-demo-3", "rg-button-group", {
group: {
style: "success",
rounded: true,
size: "large",
buttons: [
{text: "Btn **1**"},
{text: "Btn **2**"},
{text: "Btn **3**", disabled: "yes"}
]
}
}) ;
tags[0].on ("button-clicked", function (e){console.log("button-clicked:", e);})