選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

212 行
9.2 KiB

  1. <div class="bs-docs-section">
  2. <h1 id="progress" class="page-header">Progress bars</h1>
  3. <p class="lead">Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars.</p>
  4. <div class="bs-callout bs-callout-danger">
  5. <h4>Cross-browser compatibility</h4>
  6. <p>Progress bars use CSS3 transitions and animations to achieve some of their effects. These features are not supported in Internet Explorer 9 and below or older versions of Firefox. Opera 12 does not support animations.</p>
  7. </div>
  8. <h3 id="progress-basic">Basic example</h3>
  9. <p>Default progress bar.</p>
  10. <div class="bs-example">
  11. <div class="progress">
  12. <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
  13. <span class="sr-only">60% Complete</span>
  14. </div>
  15. </div>
  16. </div>
  17. {% highlight html %}
  18. <div class="progress">
  19. <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
  20. <span class="sr-only">60% Complete</span>
  21. </div>
  22. </div>
  23. {% endhighlight %}
  24. <h3 id="progress-label">With label</h3>
  25. <p>Remove the <code>.sr-only</code> class from within the progress bar to show a visible percentage. For low percentages, consider adding a <code>min-width</code> to ensure the label's text is fully visible.</p>
  26. <div class="bs-example">
  27. <div class="progress">
  28. <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
  29. 60%
  30. </div>
  31. </div>
  32. </div>
  33. {% highlight html %}
  34. <div class="progress">
  35. <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
  36. 60%
  37. </div>
  38. </div>
  39. {% endhighlight %}
  40. <h3 id="progress-low-percentages">Low percentages</h3>
  41. <p>Progress bars representing low single digit percentages, as well as 0%, include a <code>min-width: 20px;</code> for legibility.</p>
  42. <div class="bs-example">
  43. <div class="progress">
  44. <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
  45. 0%
  46. </div>
  47. </div>
  48. <div class="progress">
  49. <div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 2%;">
  50. 2%
  51. </div>
  52. </div>
  53. </div>
  54. {% highlight html %}
  55. <div class="progress">
  56. <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
  57. 0%
  58. </div>
  59. </div>
  60. <div class="progress">
  61. <div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 2%;">
  62. 2%
  63. </div>
  64. </div>
  65. {% endhighlight %}
  66. <h3 id="progress-alternatives">Contextual alternatives</h3>
  67. <p>Progress bars use some of the same button and alert classes for consistent styles.</p>
  68. <div class="bs-example">
  69. <div class="progress">
  70. <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
  71. <span class="sr-only">40% Complete (success)</span>
  72. </div>
  73. </div>
  74. <div class="progress">
  75. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
  76. <span class="sr-only">20% Complete</span>
  77. </div>
  78. </div>
  79. <div class="progress">
  80. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
  81. <span class="sr-only">60% Complete (warning)</span>
  82. </div>
  83. </div>
  84. <div class="progress">
  85. <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
  86. <span class="sr-only">80% Complete (danger)</span>
  87. </div>
  88. </div>
  89. </div>
  90. {% highlight html %}
  91. <div class="progress">
  92. <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
  93. <span class="sr-only">40% Complete (success)</span>
  94. </div>
  95. </div>
  96. <div class="progress">
  97. <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
  98. <span class="sr-only">20% Complete</span>
  99. </div>
  100. </div>
  101. <div class="progress">
  102. <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
  103. <span class="sr-only">60% Complete (warning)</span>
  104. </div>
  105. </div>
  106. <div class="progress">
  107. <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
  108. <span class="sr-only">80% Complete (danger)</span>
  109. </div>
  110. </div>
  111. {% endhighlight %}
  112. <h3 id="progress-striped">Striped</h3>
  113. <p>Uses a gradient to create a striped effect. Not available in IE8.</p>
  114. <div class="bs-example">
  115. <div class="progress">
  116. <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
  117. <span class="sr-only">40% Complete (success)</span>
  118. </div>
  119. </div>
  120. <div class="progress">
  121. <div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
  122. <span class="sr-only">20% Complete</span>
  123. </div>
  124. </div>
  125. <div class="progress">
  126. <div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
  127. <span class="sr-only">60% Complete (warning)</span>
  128. </div>
  129. </div>
  130. <div class="progress">
  131. <div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
  132. <span class="sr-only">80% Complete (danger)</span>
  133. </div>
  134. </div>
  135. </div>
  136. {% highlight html %}
  137. <div class="progress">
  138. <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
  139. <span class="sr-only">40% Complete (success)</span>
  140. </div>
  141. </div>
  142. <div class="progress">
  143. <div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
  144. <span class="sr-only">20% Complete</span>
  145. </div>
  146. </div>
  147. <div class="progress">
  148. <div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
  149. <span class="sr-only">60% Complete (warning)</span>
  150. </div>
  151. </div>
  152. <div class="progress">
  153. <div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
  154. <span class="sr-only">80% Complete (danger)</span>
  155. </div>
  156. </div>
  157. {% endhighlight %}
  158. <h3 id="progress-animated">Animated</h3>
  159. <p>Add <code>.active</code> to <code>.progress-bar-striped</code> to animate the stripes right to left. Not available in IE9 and below.</p>
  160. <div class="bs-example">
  161. <div class="progress">
  162. <div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"><span class="sr-only">45% Complete</span></div>
  163. </div>
  164. <button type="button" class="btn btn-default bs-docs-activate-animated-progressbar" data-toggle="button" aria-pressed="false" autocomplete="off">Toggle animation</button>
  165. </div>
  166. {% highlight html %}
  167. <div class="progress">
  168. <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
  169. <span class="sr-only">45% Complete</span>
  170. </div>
  171. </div>
  172. {% endhighlight %}
  173. <h3 id="progress-stacked">Stacked</h3>
  174. <p>Place multiple bars into the same <code>.progress</code> to stack them.</p>
  175. <div class="bs-example">
  176. <div class="progress">
  177. <div class="progress-bar progress-bar-success" style="width: 35%">
  178. <span class="sr-only">35% Complete (success)</span>
  179. </div>
  180. <div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%">
  181. <span class="sr-only">20% Complete (warning)</span>
  182. </div>
  183. <div class="progress-bar progress-bar-danger" style="width: 10%">
  184. <span class="sr-only">10% Complete (danger)</span>
  185. </div>
  186. </div>
  187. </div>
  188. {% highlight html %}
  189. <div class="progress">
  190. <div class="progress-bar progress-bar-success" style="width: 35%">
  191. <span class="sr-only">35% Complete (success)</span>
  192. </div>
  193. <div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%">
  194. <span class="sr-only">20% Complete (warning)</span>
  195. </div>
  196. <div class="progress-bar progress-bar-danger" style="width: 10%">
  197. <span class="sr-only">10% Complete (danger)</span>
  198. </div>
  199. </div>
  200. {% endhighlight %}
  201. </div>