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/" />
8 <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9 <script src="../../js/jquery.js"></script>
10 <script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
11 <script src="../_assets/js/jqm-docs.js"></script>
12 <script src="../../js/"></script>
16 <div data-role="page" class="type-interior">
18 <div data-role="header" data-theme="f">
19 <h1>Theming lists</h1>
20 <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
21 </div><!-- /header -->
23 <div data-role="content" class="ui-body">
24 <div class="content-primary">
26 <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>
29 <ul data-role="listview" data-inset="true">
31 <ul data-role="listview" data-inset="true" data-icon="star">
32 <li data-role="list-divider">Divider</li>
33 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
34 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
35 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
38 <h2>Theming list items</h2>
39 <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>
42 <ul data-role="listview" data-inset="true" data-theme="d">
45 <ul data-role="listview" data-inset="true" data-theme="d">
46 <li data-role="list-divider">Divider</li>
47 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
48 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
49 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
52 <p> data-theme attributes also work at the LI-level, for styling a single item.</p>
54 <ul data-role="listview" data-inset="true" data-theme="d">
55 <li data-role="list-divider">Divider</li>
56 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
57 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
58 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
59 <li data-theme="a"><a href="index.html">Trash <span class="ui-li-count">34</span></a></li>
62 <h2>Theming dividers</h2>
64 <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>
67 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e">
70 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e">
71 <li data-role="list-divider">Divider</li>
72 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
73 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
74 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
77 <h2>Theming count bubbles</h2>
79 <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>
82 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">
85 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">
86 <li data-role="list-divider">Divider</li>
87 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
88 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
89 <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
92 <h2>Theming icons</h2>
94 <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>
97 <li data-icon="info"><a href="#">Notices</a></li>
98 <li data-icon="alert"><a href="#">Alerts</a></li>
99 <li data-icon="false"><a href="#">No icon</a></li>
102 <ul data-role="listview" data-inset="true">
103 <li data-role="list-divider">Divider</li>
104 <li data-icon="info"><a href="#">Notices</a></li>
105 <li data-icon="alert"><a href="#">Alerts</a></li>
106 <li data-icon="false"><a href="#">No icon</a></li>
110 <h2>Theming split buttons</h2>
112 <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>
114 <ul data-role="listview" data-inset="true">
115 <li><a href="index.html">
116 <img src="images/album-bb.jpg" />
117 <h3>Broken Bells</h3>
118 <p>Broken Bells</p></a>
119 <a href="index.html">Purchase album</a>
121 <li><a href="index.html">
122 <img src="images/album-hc.jpg" />
125 <a href="index.html">Purchase album</a>
130 <ul data-role="listview" data-inset="true" data-split-theme="a">
132 <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>
133 <ul data-role="listview" data-inset="true" data-split-theme="a">
134 <li><a href="index.html">
135 <img src="images/album-bb.jpg" />
136 <h3>Broken Bells</h3>
139 <a href="index.html">Purchase album</a>
141 <li><a href="index.html">
142 <img src="images/album-hc.jpg" />
146 <a href="index.html" data-theme="e">Purchase album</a>
150 <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>
153 <ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete">
156 <ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete" >
157 <li><a href="index.html">
158 <img src="images/album-bb.jpg" />
159 <h3>Broken Bells</h3>
162 <a href="index.html">Purchase album</a>
164 <li><a href="index.html">
165 <img src="images/album-hc.jpg" />
169 <a href="index.html">Purchase album</a>
175 <h2>Examples of all basic list swatches</h2>
177 <p><strong>A</strong> swatch</p>
178 <ul data-role="listview" data-inset="true" data-theme="a">
179 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
180 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
181 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
184 <p><strong>B</strong> swatch</p>
185 <ul data-role="listview" data-inset="true" data-theme="b">
186 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
187 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
188 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
191 <p><strong>C</strong> swatch</p>
192 <ul data-role="listview" data-inset="true" data-theme="c">
193 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
194 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
195 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
198 <p><strong>D</strong> swatch</p>
199 <ul data-role="listview" data-inset="true" data-theme="d">
200 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
201 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
202 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
205 <p><strong>E</strong> swatch</p>
206 <ul data-role="listview" data-inset="true" data-theme="e">
207 <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
208 <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
209 <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
213 </div><!--/content-primary -->
215 <div class="content-secondary">
217 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
219 <h3>More in this section</h3>
221 <ul data-role="listview" data-theme="c" data-dividertheme="d">
223 <li data-role="list-divider">List views</li>
224 <li><a href="docs-lists.html">List markup conventions</a></li>
225 <li><a href="lists-ul.html">Basic linked list</a></li>
226 <li><a href="lists-nested.html">Nested list</a></li>
227 <li><a href="lists-ol.html">Numbered list</a></li>
229 <li><a href="lists-split.html">Split button list</a></li>
230 <li><a href="lists-divider.html">List dividers</a></li>
231 <li><a href="lists-count.html">Count bubble</a></li>
232 <li><a href="lists-thumbnails.html">Thumbnails</a></li>
233 <li><a href="lists-icons.html">Icons</a></li>
234 <li><a href="lists-formatting.html">Content formatting</a></li>
235 <li><a href="lists-search.html">Search filter bar</a></li>
236 <li><a href="lists-search-inset.html">Inset search filter bar</a></li>
237 <li><a href="lists-search-with-dividers.html">Search filter bar with dividers</a></li>
239 <li><a href="lists-readonly.html">Read-only lists</a></li>
240 <li><a href="lists-readonly-inset.html">Read-only inset lists</a></li>
241 <li><a href="lists-forms.html">Lists with forms</a></li>
242 <li><a href="lists-forms-inset.html">Inset lists with forms</a></li>
244 <li><a href="lists-inset.html">Inset styled lists</a></li>
245 <li><a href="lists-performance.html">List performance test</a></li>
246 <li data-theme="a"><a href="lists-themes.html">Theming lists</a></li>
252 </div><!-- /content -->
254 <div data-role="footer" class="footer-docs" data-theme="c">
255 <p>© 2011 The jQuery Project</p>