Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bars.html « components « docs - github.com/picturepan2/spectre.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f34b1c80325d6e27d62393808a50090b18ebbf6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Bars - Components - Spectre.css CSS Framework</title>
    <meta charset="utf-8">
    <meta name="robots" content="index, follow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="description" content="Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.">
    <meta name="author" content="Yan Zhu">
    <link rel="shortcut icon" href="../img/favicons/favicon.ico">
    <link rel="icon" href="../img/favicons/favicon.png">
    <link rel="stylesheet" href="../dist/spectre.min.css">
    <link rel="stylesheet" href="../dist/spectre-icons.min.css">
    <link rel="stylesheet" href="../dist/spectre-exp.min.css">
    <link rel="stylesheet" href="../dist/docs.min.css">
    <link rel="canonical" href="https://picturepan2.github.io/spectre/components/bars.html">
  </head>
  <body>
    <div class="docs-container off-canvas off-canvas-sidebar-show">
      <div class="docs-navbar"><a class="off-canvas-toggle btn btn-link btn-action" href="#sidebar"><i class="icon icon-menu"></i></a>
        <div class="btns"><a class="btn btn-primary float-right" href="https://github.com/picturepan2/spectre" target="_blank">GitHub</a><a class="btn mr-1 float-right" href="https://www.paypal.me/picturepan2" target="_blank">Sponsor</a></div>
      </div>
      <div class="docs-sidebar off-canvas-sidebar" id="sidebar">
        <div class="docs-brand"><a class="docs-logo" href="../index.html"><img src="../img/spectre-logo.svg" alt="Spectre.css CSS Framework">
            <h2>SPECTRE</h2></a>
        </div>
        <div class="docs-nav">
          <div class="accordion-container">
            <div class="accordion">
              <input id="accordion-getting-started" type="checkbox" name="docs-accordion-checkbox" hidden=""/>
              <label class="accordion-header c-hand" for="accordion-getting-started">Getting started</label>
              <div class="accordion-body">
                <ul class="menu menu-nav">
                  <li class="menu-item"><a href="../getting-started/installation.html">Installation</a>
                  </li>
                  <li class="menu-item"><a href="../getting-started/custom.html">Custom version</a>
                  </li>
                  <li class="menu-item"><a href="../getting-started/browsers.html">Browser support</a>
                  </li>
                  <li class="menu-item"><a href="../getting-started/whatsnew.html">What's new</a>
                  </li>
                </ul>
              </div>
            </div>
            <div class="accordion">
              <input id="accordion-elements" type="checkbox" name="docs-accordion-checkbox" hidden=""/>
              <label class="accordion-header c-hand" for="accordion-elements">Elements</label>
              <div class="accordion-body">
                <ul class="menu menu-nav">
                  <li class="menu-item"><a href="../elements/typography.html">Typography</a>
                  </li>
                  <li class="menu-item"><a href="../elements/tables.html">Tables</a>
                  </li>
                  <li class="menu-item"><a href="../elements/buttons.html">Buttons</a>
                  </li>
                  <li class="menu-item"><a href="../elements/forms.html">Forms</a>
                  </li>
                  <li class="menu-item"><a href="../elements/icons.html">Icons</a>
                  </li>
                  <li class="menu-item"><a href="../elements/labels.html">Labels</a>
                  </li>
                  <li class="menu-item"><a href="../elements/code.html">Code</a>
                  </li>
                  <li class="menu-item"><a href="../elements/media.html">Media</a>
                  </li>
                </ul>
              </div>
            </div>
            <div class="accordion">
              <input id="accordion-layout" type="checkbox" name="docs-accordion-checkbox" hidden=""/>
              <label class="accordion-header c-hand" for="accordion-layout">Layout</label>
              <div class="accordion-body">
                <ul class="menu menu-nav">
                  <li class="menu-item"><a href="../layout/grid.html">Flexbox grid</a>
                  </li>
                  <li class="menu-item"><a href="../layout/responsive.html">Responsive</a>
                  </li>
                  <li class="menu-item"><a href="../layout/navbar.html">Navbar</a>
                  </li>
                </ul>
              </div>
            </div>
            <div class="accordion">
              <input id="accordion-components" type="checkbox" name="docs-accordion-checkbox" hidden="" checked="checked"/>
              <label class="accordion-header c-hand" for="accordion-components">Components</label>
              <div class="accordion-body">
                <ul class="menu menu-nav">
                  <li class="menu-item"><a href="../components/accordions.html">Accordions</a>
                  </li>
                  <li class="menu-item"><a href="../components/avatars.html">Avatars</a>
                  </li>
                  <li class="menu-item"><a href="../components/badges.html">Badges</a>
                  </li>
                  <li class="menu-item"><a href="../components/bars.html">Bars</a>
                  </li>
                  <li class="menu-item"><a href="../components/breadcrumbs.html">Breadcrumbs</a>
                  </li>
                  <li class="menu-item"><a href="../components/cards.html">Cards</a>
                  </li>
                  <li class="menu-item"><a href="../components/chips.html">Chips</a>
                  </li>
                  <li class="menu-item"><a href="../components/empty.html">Empty states</a>
                  </li>
                  <li class="menu-item"><a href="../components/menu.html">Menu</a>
                  </li>
                  <li class="menu-item"><a href="../components/modals.html">Modals</a>
                  </li>
                  <li class="menu-item"><a href="../components/nav.html">Nav</a>
                  </li>
                  <li class="menu-item"><a href="../components/pagination.html">Pagination</a>
                  </li>
                  <li class="menu-item"><a href="../components/panels.html">Panels</a>
                  </li>
                  <li class="menu-item"><a href="../components/popovers.html">Popovers</a>
                  </li>
                  <li class="menu-item"><a href="../components/steps.html">Steps</a>
                  </li>
                  <li class="menu-item"><a href="../components/tabs.html">Tabs</a>
                  </li>
                  <li class="menu-item"><a href="../components/tiles.html">Tiles</a>
                  </li>
                  <li class="menu-item"><a href="../components/toasts.html">Toasts</a>
                  </li>
                  <li class="menu-item"><a href="../components/tooltips.html">Tooltips</a>
                  </li>
                </ul>
              </div>
            </div>
            <div class="accordion">
              <input id="accordion-utilities" type="checkbox" name="docs-accordion-checkbox" hidden=""/>
              <label class="accordion-header c-hand" for="accordion-utilities">Utilities</label>
              <div class="accordion-body">
                <ul class="menu menu-nav">
                  <li class="menu-item"><a href="../utilities/colors.html">Colors</a>
                  </li>
                  <li class="menu-item"><a href="../utilities/cursors.html">Cursors</a>
                  </li>
                  <li class="menu-item"><a href="../utilities/display.html">Display</a>
                  </li>
                  <li class="menu-item"><a href="../utilities/divider.html">Divider</a>
                  </li>
                  <li class="menu-item"><a href="../utilities/loading.html">Loading</a>
                  </li>
                  <li class="menu-item"><a href="../utilities/position.html">Position</a>
                  </li>
                  <li class="menu-item"><a href="../utilities/shapes.html">Shapes</a>
                  </li>
                  <li class="menu-item"><a href="../utilities/text.html">Text</a>
                  </li>
                </ul>
              </div>
            </div>
            <div class="accordion">
              <input id="accordion-experimentals" type="checkbox" name="docs-accordion-checkbox" hidden=""/>
              <label class="accordion-header c-hand" for="accordion-experimentals">Experimentals</label>
              <div class="accordion-body">
                <ul class="menu menu-nav">
                  <li class="menu-item"><a href="../experimentals/autocomplete.html">Autocomplete</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/calendars.html">Calendars</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/carousels.html">Carousels</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/comparison.html">Comparison sliders</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/filters.html">Filters</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/meters.html">Meters</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/off-canvas.html">Off-canvas</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/parallax.html">Parallax</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/progress.html">Progress</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/sliders.html">Sliders</a>
                  </li>
                  <li class="menu-item"><a href="../experimentals/timelines.html">Timelines</a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div><a class="off-canvas-overlay" href="#close"></a>
      <div class="off-canvas-content">
        <div class="docs-content" id="content">
          <div class="container" id="bars">
            <h3 class="s-title">Bars<a class="anchor" href="#bars" aria-hidden="true">#</a></h3>
            <div class="docs-ad">
              <div class="hide-md text-center">
                <script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                <!-- GitHub-lg--><ins class="adsbygoogle mx-auto" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-2225124559530218" data-ad-slot="9894180784"></ins>
                <script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
              </div>
              <div class="show-md text-center">
                <!-- GitHub-sm--><ins class="adsbygoogle" style="display:inline-block;width:300px;height:250px" data-ad-client="ca-pub-2225124559530218" data-ad-slot="9278881734"></ins>
                <script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
              </div>
            </div>
            <p>
              Bars represent the progress of a task or the value within the known range.
              Bars are custom components for displaying HTML5 &lt;progress&gt;, &lt;meter&gt; and input range elements.
            </p>
            <div class="docs-demo columns">
              <div class="column col-8 col-xs-12">
                <div class="bar bar-sm">
                  <div class="bar-item tooltip" data-tooltip="25%" role="progressbar" style="width:25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                </div>
              </div>
              <div class="column col-8 col-xs-12">
                <div class="bar">
                  <div class="bar-item tooltip" data-tooltip="50%" role="progressbar" style="width:50%;"></div>
                </div>
              </div>
              <div class="column col-8 col-xs-12">
                <div class="bar">
                  <div class="bar-item tooltip" data-tooltip="25%" role="progressbar" style="width:25%;">25%</div>
                  <div class="bar-item tooltip" data-tooltip="15%" role="progressbar" style="width:15%;background:#817fe3;">15%</div>
                  <div class="bar-item tooltip" data-tooltip="10%" role="progressbar" style="width:10%;background:#aaa9eb;">10%</div>
                  <div class="bar-item tooltip" data-tooltip="15%" role="progressbar" style="width:15%;">15%</div>
                </div>
              </div>
            </div>
            <p>Add a container element with the <code>bar</code> class.
              And add child elements with the <code>bar-item</code> class.
              The width percentage value is needed for every <code>bar-item</code>.
            </p>
            <p>There is the <code>bar-sm</code> class for thinner Bars.
              Also, you could use <a href="#tooltips">Tooltips</a> for any <code>bar-item</code>.
            </p>
            <pre class="code" data-lang="HTML"><code><span class="hljs-comment">&lt;!-- normal bars --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar bar-sm"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-item"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"progressbar"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width:25%;"</span> <span class="hljs-attr">aria-valuenow</span>=<span class="hljs-string">"25"</span> <span class="hljs-attr">aria-valuemin</span>=<span class="hljs-string">"0"</span> <span class="hljs-attr">aria-valuemax</span>=<span class="hljs-string">"100"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-comment">&lt;!-- multi-bars --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-item tooltip"</span> <span class="hljs-attr">data-tooltip</span>=<span class="hljs-string">"25%"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width:25%;"</span>&gt;</span>25%<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-item"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width:15%;background:#818bd5;"</span>&gt;</span>15%<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
            <h4 class="s-subtitle" id="bars-slider">Slider bars<a class="anchor" href="#bars-slider" aria-hidden="true">#</a></h4>
            <div class="docs-demo columns">
              <div class="column col-8 col-xs-12">
                <div class="bar bar-slider">
                  <div class="bar-item" role="progressbar" style="width:50%;">
                    <button class="bar-slider-btn btn tooltip" data-tooltip="50%" role="slider"></button>
                  </div>
                </div>
              </div>
              <div class="column col-8 col-xs-12">
                <div class="bar bar-slider">
                  <div class="bar-item" role="progressbar" style="width:15%;">
                    <button class="bar-slider-btn btn tooltip" data-tooltip="25%" role="slider"></button>
                  </div>
                  <div class="bar-item" role="progressbar" style="width:65%;">
                    <button class="bar-slider-btn btn tooltip" data-tooltip="65%" role="slider"></button>
                  </div>
                </div>
              </div>
            </div>
            <p>You can add the <code>bar-slider</code> class to the Bars container.
              And add child elements with the <code>bar-item</code> class and <code>bar-slider-btn</code> inside bar-item.
              You need to set the <code>bar-item</code> width manually to have the slider point.
            </p>
            <p>If there are two <code>bar-item</code> divs in one bar-slider, you will have a range slider.</p>
            <pre class="code" data-lang="HTML"><code><span class="hljs-comment">&lt;!-- normal slider --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar bar-slider"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-item"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"progressbar"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width:25%;"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-slider-btn btn"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"slider"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-comment">&lt;!-- range slider --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar bar-slider"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-item"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"progressbar"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width:15%;"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-slider-btn btn"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"slider"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-item"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"progressbar"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width:65%;"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bar-slider-btn btn"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"slider"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
            <div class="docs-ad docs-ad-sidebar text-center">
              <script id="_carbonads_js" async="" type="text/javascript" src="https://cdn.carbonads.com/carbon.js?serve=CK7DTKQW&amp;placement=picturepan2githubio"></script>
            </div>
          </div>
          <div class="docs-footer container grid-lg" id="copyright">
            <p><a href="getting-started.html" target="_blank">Documents</a> · <a href="https://github.com/picturepan2/spectre" target="_blank">GitHub</a> · <a href="https://twitter.com/spectrecss" target="_blank">Twitter</a> · <a href="https://www.paypal.me/picturepan2" target="_blank">PayPal Donate</a> · Version <span class="version"></span></p>
            <p>Designed and built with <span class="text-error">&hearts;</span> by <a href="https://twitter.com/picturepan2" target="_blank">Yan Zhu</a>. Licensed under the <a href="https://github.com/picturepan2/spectre/blob/master/LICENSE" target="_blank">MIT License</a>.</p>
          </div>
        </div>
      </div>
    </div>
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
      
      ga('create', 'UA-2702768-8', 'auto');
      ga('send', 'pageview');
    </script>
  </body>
</html>