The Kendo mobile ButtonGroup widget presents a linear set of grouped buttons.

Getting Started

The Kendo mobile Application will automatically initialize a mobile ButtonGroup for every element with role data attribute set to buttongroup present in the views/layouts markup. Alternatively, it can be initialized using jQuery plugin syntax in the containing mobile View init event handler. The ButtonGroup element should be UL element.

Initialize Kendo mobile ButtonGroup based on role data attribute.

<ul id="buttongroup" data-role="buttongroup">
  <li>Option 1</li>
  <li>Option 2</li>
</ul>

Initialize Kendo mobile ButtonGroup using jQuery plugin syntax

var buttongroup = $("#buttongroup").kendoMobileButtonGroup();

Customizing Mobile ButtonGroup Appearance

Every Kendo Mobile ButtonGroup color can be customized by setting the respective background-color CSS property inline or with a CSS selector.

Green Kendo mobile ButtonGroup

<ul id="buttongroup" data-role="buttongroup">
  <li style="background-color: green">Option1</li>
  <li style="beckground-color: red">Option2</li>
</ul>

Button Icons

A Button icon can be set in two ways - either by adding an img element inside the Button a element, or by setting an icon data attribute to the Button a element.

KendoUI Mobile ships with several ready to use icons:

Creating Custom Icons

In order to create colorizable icons like the default ones in Kendo UI Mobile, specify the icon image as a box mask (either as dataURI or as a separate image). The image should be PNG8 or PNG24 with alpha channel (PNG8+Alpha is supported by only few graphic editors, so better stick with PNG24). The image color is not important - it will be used as a mask only.

Note: BlackBerry 7.0 has a bug that renders its masks as background-image, so it is recommended to use white in order to support it. The bug is fixed in 7.1.

Define custom button icon

<style>
.km-custom {
  -webkit-mask-box-image: url("foo.png");
}
</style>

<ul id="buttongroup" data-role="buttongroup">
  <li data-icon="custom">Option 1</li>
  <li>Option 2</li>
</ul>