Button basics

Home

Button basics

The following options apply to all buttons:

corners boolean

default: true

Applies the theme button border-radius if set to true. This option is also exposed as a data attribute: data-corners="false"

$('a').buttonMarkup({ corners: "false" });
No rounded corners
icon string

default: null

Applies an icon from the icon set. This option is also exposed as a data attribute: data-icon="star"

$('a').buttonMarkup({ icon: "star" });
Star icon
iconpos string

default: "left"

Positions the icon in the button. Possible values: left, right, none, notext. The notext value will display an icon-only button with no text feedback. This option is also exposed as a data attribute: data-iconpos="left"

$('a').buttonMarkup({ iconpos: "right" });
Star icon
iconshadow boolean

default: true

Applies the theme shadow to the button's icon if set to true. This option is also exposed as a data attribute: data-iconshadow="false"

$('a').buttonMarkup({ iconshadow: "false" });
No icon shadow
inline boolean

default: null (false)

If set to true, this will make the button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the button is full width, regardless of the feedback content. Possible values: true, false. This option is also exposed as a data attribute: data-inline="true"

$('a').buttonMarkup({ inline: "true" });
Inline
shadow boolean

default: true

Applies the drop shadow style to the button if set to true. This option is also exposed as a data attribute: data-shadow="false"

$('a').buttonMarkup({ shadow: "false" });
No button shadow
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('a').buttonMarkup({ theme: "a" });
Theme A

The following option applies only to form buttons, which are automatically initialized by the framework:

initSelector CSS selector string

default: "button, [type='button'], [type='submit'], [type='reset'], [type='image']"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as form buttons. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
   $.mobile.button.prototype.options.initSelector = ".myButtons";
});