container with data-role="fieldcontain" to improve label styling.
Data-attributes
Value
Description
data-mini
true | false
Specifies whether the control group is small or regular size
data-type
horizontal | vertical
Specifies whether the control group is displayed horizontally or vertically
Dialogs
A container with data-role="dialog" or a link with data-rel="dialog".
Data-attributes
Value
Description
data-close-btn-text
sometext
Specifies the text of the dialog close button
data-dom-cache
true | false
Specifies whether to clear the jQuery DOM cache of individual pages (if set to true, you must manage the DOM yourself and test on all mobile devices)
data-overlay-theme
Common Format Patterns (a-z)
Specifies the overlay (background) color of the dialog page
data-theme
Common Format Patterns (a-z)
Specifies the theme color of the dialog page
data-title
sometext
Specifies the title of the dialog page
Enhancement
A container with data-enhance="false" or data-ajax="false".
Data-attributes
Value
Description
data-enhance
**true **| false
If set to "true" (default), jQuery Mobile automatically renders the page to make it more suitable for mobile devices. If set to "false", the framework will not render the page
data-ajax
**true **| false
Specifies whether to load pages via ajax
**Note:** data-enhance="false" must be used together with $.mobile.ignoreContentEnabled=true" to prevent jQuery Mobile from automatically rendering the page.
When $.mobile.ignoreContentEnabled is set to true, any links or form elements inside a data-ajax="false" container will be ignored by the framework's navigation features.
Field container
Deprecated after version 1.4 and no longer supported after version 1.5; class="ui-fieldcontain will be used instead". A container that wraps a label/form element pair with data-role="fieldcontain".
Fixed toolbar
A container with data-role="header" or data-role="footer" and the data-position="fixed" attribute.
Data-attributes
Value
Description
data-disable-page-zoom
true | false
Specifies whether the user can zoom the page
data-fullscreen
true | false
Specifies whether the toolbar is always fixed at the top or bottom
data-tap-toggle
true | false
Specifies whether the user can change the toolbar's visibility by clicking
data-transition
slide | fade | none
Specifies the transition effect when a click occurs
data-update-page-padding
true | false
Specifies whether the padding at the top and bottom of the page is updated when resize, transition, and "updatelayout" events occur (jQuery Mobile always updates padding when the "pageshow" event occurs)
data-visible-on-page-show
true | false
Specifies the visibility of the toolbar when the parent page is shown
Flip toggle switches
An element with data-role="slider" and two element. Data-Attribute Value Description data-minitrue | false Specifies whether the switch is small or regular size data-rolenone Prevents jQuery Mobile from rendering the toggle switch as a button style data-themeletter (a-z) Specifies the theme color of the toggle switch data-track-themeletter (a-z) Specifies the theme color of the track Footer A container with data-role="footer". Data-Attribute Value Description data-idsometext Specifies a unique ID. Required for a persistent footer data-positioninline | fixed Specifies whether the footer is inlined with the page content or kept fixed at the bottom data-fullscreentrue | false Specifies whether the footer is fixed at the bottom or overlays the page content (see larger scope) data-themeletter (a-z) Specifies the theme color of the footer. Default is "a" **Note:** To enable fullscreen positioning, use data-position="fixed", then add the data-fullscreen attribute to the element. Header A container with data-role="header". Data-Attribute Value Description data-idsometext Specifies a unique ID. Required for a persistent header data-positioninline | fixed Specifies whether the header is inlined with the page content or kept fixed at the top data-fullscreentrue | false Specifies whether the header is fixed at the top or overlays the page content (see larger scope) data-themeletter (a-z) Specifies the theme color of the header. Default is "a" **Note:** To enable fullscreen positioning, use data-position="fixed", then add the data-fullscreen attribute to the element. Links All links, including those with data-role="button" and form submit buttons. Data-Attribute Value Description data-ajaxtrue | false Specifies whether to load pages via ajax to improve user experience and interaction. If set to false, jQuery Mobile will perform a normal page request. data-directionreverse Reverse transition animation (only for pages and dialogs) data-dom-cachetrue | false Specifies whether to clear the jQuery DOM cache of individual pages (if set to true, you must manage the DOM yourself and test on all mobile devices) data-prefetchtrue | false Specifies whether to pre-fetch pages into the DOM so they are available when the user visits them data-relback | dialog | external | popup Options that specify the link behavior. Back - Go back to the previous page in history. Dialog - Open the link as a dialog, not saved to history. External - Used to link to another domain. Popup - Open a popup window. data-transitionfade | flip | flow | pop | slide | slidedown | slidefade | slideup | turn | none Specifies the effect of transitioning from one page to the next. See our jQuery Mobile page transitions chapter. data-position-toorigin | jQuery selector | window Specifies the position of the popup. Origin - Default. Positions the popup on the link that opened it. jQuery selector - Positions the popup on the specified element. Window - Positions the popup in the center of the window screen. List A or with data-role="listview". Data-Attribute Value Description data-autodividerstrue | false Specifies whether to automatically divide list items data-count-themeletter (a-z) Specifies the theme color of the count bubble. data-divider-themeletter (a-z) Specifies the theme color of the list divider. data-filtertrue | false Specifies whether to add a search box to the list data-filter-placeholdersometext Deprecated since version 1.4. Use the HTML placeholder attribute instead. Specifies the text inside the search box. Default is "Filter items..." data-filter-themeletter (a-z) Specifies the theme color of the search filter. data-iconIcon reference manual Specifies the icon of the list data-insettrue | false Specifies whether the list is rendered with rounded corners and margins data-split-iconIcon reference manual Specifies the icon of the split button. Default is "arrow-r" data-split-themeletter (a-z) Specifies the theme color of the split button. data-themeletter (a-z) Specifies the theme color of the list List item A inside a or with data-role="listview". Data-Attribute Value Description data-filtertextsometext Specifies the text to search when filtering elements. This text will be filtered instead of the actual list item text data-iconIcon reference manual Specifies the list item icon data-rolelist-divider Specifies the division of list items data-themeletter (a-z) Specifies the theme color of the list item **Note:** The data-icon attribute only applies to list items with links. Navbar The element inside a container with data-role="navbar". Data-Attribute Value Description data-iconIcon reference manual Specifies the icon of the list item data-iconposleft | right | top | bottom | notext Specifies the position of the icon Navbars inherit their theme swatch from their parent container. It is impossible to set the data-theme attribute for a navbar. You can set the data-theme attribute individually for each link in the navbar. Page A container with data-role="page". Data-Attribute Value Description data-add-back-btntrue | false Automatically add a back button, header only data-back-btn-textsometext Specifies some text for the back button data-back-btn-themeletter (a-z) Specifies the theme color of the back button data-close-btn-textletter (a-z) Specifies some text for the close button on the dialog data-dom-cachetrue | false Specifies whether to clear the jQuery DOM cache of individual pages (if set to true, you must manage the DOM yourself and test on all mobile devices) data-overlay-themeletter (a-z) Specifies the overlay (background) color of the dialog page data-themeletter (a-z) Specifies the theme color of the page. data-titlesometext Specifies the page title data-urlurl Updates the value of the URL, rather than the URL used to request the page Popup A container with data-role="popup". Data-Attribute Value Description data-cornerstrue | false Specifies whether the popup has rounded corners data-overlay-themeletter (a-z) Specifies the overlay (background) color of the popup. Default is transparent background (none) data-shadowtrue | false Specifies whether the popup has a shadow data-themeletter (a-z) Specifies the theme color of the popup. Default is inherited, "none" sets the popup to be transparent data-tolerance30, 15, 30, 15 Specifies the distance from the window edges (top, right, bottom, left) An anchor with data-rel="popup": Data-Attribute Value Description data-position-toorigin | jQuery selector | window> Specifies the position of the popup. Origin - Default. Positions the popup on the link that opened it. jQuery selector - Positions the popup on the specified element. Window - Positions the popup in the center of the window screen. data-relpopup Used to open the popup data-transitionfade | flip | flow | pop | slide | slidedown | slidefade | slideup | turn | none Specifies the effect of transitioning from one page to the next. See our jQuery Mobile page transitions chapter. Radio buttons Paired label and input with type="radio". They are automatically rendered as button styles, data-role is not required. Data-Attribute Value Description data-minitrue | false Specifies whether the button is small or regular size data-rolenone Prevents jQuery Mobile from rendering the radio button as an enhanced-state button, making the element display in its native HTML state data-themeletter (a-z) Specifies the theme color of the radio button To group multiple radio buttons, use a container with the data-role="controlgroup" attribute and data-type="horizontal|vertical" to specify whether to group the radio buttons horizontally or vertically. Select All elements. These are automatically rendered as button styles, date-role is not required.
Data-attributes
Value
Description
data-icon
Icon reference manual
Specifies the icon of the select element. Default is "arrow-d"
data-iconpos
left | right | top | bottom | notext
Specifies the position of the icon
data-inline
true | false
Specifies whether the select element is inline
data-mini
true | false
Specifies whether the select element is small or regular size
data-native-menu
true | false
When set to false, it uses jQuery's own custom select menu (recommended if you want the select menu to look the same on all mobile devices)
data-overlay-theme
Common Format Patterns (a-z)
Specifies the theme color of jQuery's own custom select menu (used with data-native-menu="false")
data-placeholder
true | false
Can be set on the element of a non-native select menu
data-role
none
Prevents jQuery Mobile from rendering the select element as a button style
data-theme
Common Format Patterns (a-z)
Specifies the theme color of the select element
To group multiple select elements, use a container with the data-role="controlgroup" attribute and data-type="horizontal|vertical" to specify whether to group the select elements horizontally or vertically.
Slider
An input with type="range". These are automatically rendered as button styles, date-role is not required.
Data-attributes
Value
Description
data-highlight
true | false
Specifies whether the slider track is highlighted
data-mini
true | false
Specifies whether the slider is small or regular size
data-role
none
Prevents jQuery Mobile from rendering the slider control as a button style
data-theme
Common Format Patterns (a-z)
Specifies the theme color of the slider control (input, handle, and track)
data-track-theme
Common Format Patterns (a-z)
Specifies the theme color of the slider track
Text inputs & textareas
An input or textarea element with type="text|search|etc.". These are automatically rendered as button styles, date-role is not required.
Data-attributes
Value
Description
data-mini
true | false
Specifies whether the input is small or regular size
data-role
none
Prevents jQuery Mobile from rendering the input/textarea as a button style
data-theme
Common Format Patterns (a-z)
Specifies the theme color of the input field