5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>jQuery Mobile Docs - Theming Lists</title>
7 <link rel="stylesheet" href="../../css/themes/default/jquery.mobile.css" />
8 <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
10 <script src="../../js/jquery.js"></script>
11 <script src="../../docs/_assets/js/jqm-docs.js"></script>
12 <script src="../../js/"></script>
17 <div data-role="page" class="type-interior">
19 <div data-role="header" data-theme="f">
20 <h1>Theming lists</h1>
21 <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
22 <a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
23 </div><!-- /header -->
25 <div data-role="content" class="ui-body">
26 <div class="content-primary">
28 <p>All the standard button swatches can be applied to lists. The framework assigns a default list theme swatch of "c" (silver in the default theme) and swatch "b" (blue in default theme) for dividers. Below is a default themed list.</p>
31 <ul data-role="listview" data-inset="true">
33 <ul data-role="listview" data-inset="true" data-icon="star">
34 <li data-role="list-divider">Divider</li>
35 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
36 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
37 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
40 <h2>Theming list items</h2>
41 <p>The list item color scheme can be changed to any button color theme swatch by adding the <code> data-theme</code> attribute to the list, and setting the letter theme swatch. Here is the same list above with the "a" swatch applied. </p>
44 <ul data-role="listview" data-inset="true" data-theme="d">
47 <ul data-role="listview" data-inset="true" data-theme="d">
48 <li data-role="list-divider">Divider</li>
49 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
50 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
51 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
54 <p> data-theme attributes also work at the LI-level, for styling a single item.</p>
56 <ul data-role="listview" data-inset="true" data-theme="d">
57 <li data-role="list-divider">Divider</li>
58 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
59 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
60 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
61 <li data-theme="a"><a href="index.html">Trash <span class="ui-li-count">34</span></a></li>
64 <h2>Theming dividers</h2>
66 <p>The theme for <strong>list dividers</strong> can be set by adding the <code>data-divider-theme</code> to the list and specifying a swatch letter. Here is an example of the same list above with swatch "d" set on the dividers.</p>
69 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e">
72 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e">
73 <li data-role="list-divider">Divider</li>
74 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
75 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
76 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
79 <h2>Theming count bubbles</h2>
81 <p>The theme for <strong>count bubbles</strong> can be set by adding the <code>data-count-theme</code> to the list and specifying a swatch letter. Here is an example with swatch "e" set on the dividers.</p>
84 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">
87 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">
88 <li data-role="list-divider">Divider</li>
89 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
90 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
91 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
94 <h2>Theming icons</h2>
96 <p>The default icon for each list item is <code>arrow-r</code>. To override this, set the <code> data-icon</code> attribute on the desired list item to the <a href="../buttons/buttons-icons.html">name of a standard icon</a>. To prevent icons from appearing altogether, set the <code> data-icon</code> attribute to "false".</p>
99 <li data-icon="info"><a href="#">Notices</a></li>
100 <li data-icon="alert"><a href="#">Alerts</a></li>
101 <li data-icon="false"><a href="#">No icon</a></li>
104 <ul data-role="listview" data-inset="true">
105 <li data-role="list-divider">Divider</li>
106 <li data-icon="info"><a href="#">Notices</a></li>
107 <li data-icon="alert"><a href="#">Alerts</a></li>
108 <li data-icon="false"><a href="#">No icon</a></li>
112 <h2>Theming split buttons</h2>
114 <p>For split lists which a second button, the framework default to "b" for the theme swatch (blue in the default theme) Here is a default split list:</p>
116 <ul data-role="listview" data-inset="true">
117 <li><a href="index.html">
118 <img src="images/album-bb.jpg" />
119 <h3>Broken Bells</h3>
120 <p>Broken Bells</p></a>
121 <a href="index.html">Purchase album</a>
123 <li><a href="index.html">
124 <img src="images/album-hc.jpg" />
127 <a href="index.html">Purchase album</a>
132 <ul data-role="listview" data-inset="true" data-split-theme="a">
134 <p>To specify the color swatch for the icon button on the right, add the <code>data-split-theme</code> to the list and specify a swatch letter. This attribute can also be added to individual split inside list items by adding a <code> data-theme</code> attribute to specific links (see second list item).</p>
135 <ul data-role="listview" data-inset="true" data-split-theme="a">
136 <li><a href="index.html">
137 <img src="images/album-bb.jpg" />
138 <h3>Broken Bells</h3>
141 <a href="index.html">Purchase album</a>
143 <li><a href="index.html">
144 <img src="images/album-hc.jpg" />
148 <a href="index.html" data-theme="e">Purchase album</a>
152 <p>The icon for the split theme can set at the list level by adding the <code>data-split-icon</code> to the list and specifying a <a href="../buttons/buttons-icons.html">standard icon</a>. This attribute can also be added to individual split inside list items by adding a <code> data-icon</code> attribute to specific links (see second list item).</p>
155 <ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete">
158 <ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete" >
159 <li><a href="index.html">
160 <img src="images/album-bb.jpg" />
161 <h3>Broken Bells</h3>
164 <a href="index.html">Purchase album</a>
166 <li><a href="index.html">
167 <img src="images/album-hc.jpg" />
171 <a href="index.html">Purchase album</a>
177 <h2>Examples of all basic list swatches</h2>
179 <p><strong>A</strong> swatch</p>
180 <ul data-role="listview" data-inset="true" data-theme="a">
181 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
182 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
183 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
186 <p><strong>B</strong> swatch</p>
187 <ul data-role="listview" data-inset="true" data-theme="b">
188 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
189 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
190 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
193 <p><strong>C</strong> swatch</p>
194 <ul data-role="listview" data-inset="true" data-theme="c">
195 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
196 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
197 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
200 <p><strong>D</strong> swatch</p>
201 <ul data-role="listview" data-inset="true" data-theme="d">
202 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
203 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
204 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
207 <p><strong>E</strong> swatch</p>
208 <ul data-role="listview" data-inset="true" data-theme="e">
209 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
210 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
211 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
215 </div><!--/content-primary -->
217 <div class="content-secondary">
219 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
221 <h3>More in this section</h3>
223 <ul data-role="listview" data-theme="c" data-dividertheme="d">
225 <li data-role="list-divider">List views</li>
226 <li><a href="docs-lists.html">List basics & API</a></li>
227 <li><a href="lists-ul.html">Basic linked list</a></li>
228 <li><a href="lists-nested.html">Nested list</a></li>
229 <li><a href="lists-ol.html">Numbered list</a></li>
231 <li><a href="lists-split.html">Split button list</a></li>
232 <li><a href="lists-divider.html">List dividers</a></li>
233 <li><a href="lists-count.html">Count bubble</a></li>
234 <li><a href="lists-thumbnails.html">Thumbnails</a></li>
235 <li><a href="lists-icons.html">Icons</a></li>
236 <li><a href="lists-formatting.html">Content formatting</a></li>
237 <li><a href="lists-search.html">Search filter bar</a></li>
238 <li><a href="lists-search-inset.html">Inset search filter bar</a></li>
239 <li><a href="lists-search-with-dividers.html">Search filter bar with dividers</a></li>
240 <li><a href="lists-search-filtertext.html">Search filter hidden data</a></li>
242 <li><a href="lists-readonly.html">Read-only lists</a></li>
243 <li><a href="lists-readonly-inset.html">Read-only inset lists</a></li>
244 <li><a href="lists-forms.html">Lists with forms</a></li>
245 <li><a href="lists-forms-inset.html">Inset lists with forms</a></li>
247 <li><a href="lists-inset.html">Inset styled lists</a></li>
248 <li><a href="lists-performance.html">List performance test</a></li>
249 <li data-theme="a"><a href="lists-themes.html">Theming lists</a></li>
255 </div><!-- /content -->
257 <div data-role="footer" class="footer-docs" data-theme="c">
258 <p>© 2011-12 The jQuery Foundation</p>