Holo i ka ʻike nui Holo i ka hoʻokele docs
Check
in English

Holomua

ʻO ka palapala a me nā laʻana no ka hoʻohana ʻana i nā pahu holomua maʻamau Bootstrap e hōʻike ana i ke kākoʻo no nā pahu i hoʻopaʻa ʻia, nā ʻaoʻao animated, a me nā lepili kikokikona.

Pehea e hana ai

Kūkulu ʻia nā ʻāpana holomua me ʻelua mau mea HTML, kekahi CSS e hoʻonohonoho i ka laulā, a me kekahi mau ʻano. ʻAʻole mākou e hoʻohana i ka HTML5 <progress>element , e hōʻoia ana hiki iā ʻoe ke hoʻopaʻa i nā pae holomua, hoʻoulu iā lākou, a kau i nā lepili kikokikona ma luna o lākou.

  • Hoʻohana mākou i ka .progressmea e ʻōwili ai e hōʻike i ka waiwai nui o ka pae holomua.
  • Hoʻohana mākou i ka loko .progress-bare hōʻike i ka holomua i kēia manawa.
  • Pono .progress-barke ʻano inline, papa pono, a i ʻole CSS maʻamau e hoʻonohonoho i ko lākou laulā.
  • Pono .progress-barpū kekahi i kekahi rolea me arianā ʻano e hiki ai ke ʻike ʻia, me kahi inoa hiki ke ʻike ʻia (hoʻohana ʻia aria-label, aria-labelledby, a i ʻole like).

E hoʻohui i nā mea a pau, a loaʻa iā ʻoe kēia mau hiʻohiʻona.

html
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-label="Basic example" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-label="Basic example" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-label="Basic example" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-label="Basic example" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-label="Basic example" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Hāʻawi ʻo Bootstrap i kahi lima o nā pono hana no ka hoʻonohonoho ʻana i ka laulā . Ma muli o kāu mau pono, kōkua paha kēia i ka hoʻonohonoho wikiwiki ʻana i ka holomua.

html
<div class="progress">
  <div class="progress-bar w-75" role="progressbar" aria-label="Basic example" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Lepili

Hoʻohui i nā lepili i kāu mau pae holomua ma ke kau ʻana i nā kikokikona i loko o ka .progress-bar.

25%
html
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-label="Example with label" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">25%</div>
</div>

Kiʻekiʻe

Hoʻonoho wale mākou i kahi heightwaiwai ma ka .progress, no laila inā hoʻololi ʻoe i kēlā waiwai .progress-bare hoʻololi ʻokoʻa ka mea i loko.

html
<div class="progress" style="height: 1px;">
  <div class="progress-bar" role="progressbar" aria-label="Example 1px high" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress" style="height: 20px;">
  <div class="progress-bar" role="progressbar" aria-label="Example 20px high" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Nā kāʻei kua

E hoʻohana i nā papa hana hope e hoʻololi i ke ʻano o nā pae holomua.

html
<div class="progress">
  <div class="progress-bar bg-success" role="progressbar" aria-label="Success example" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar bg-info" role="progressbar" aria-label="Info example" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar bg-warning" role="progressbar" aria-label="Warning example" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar bg-danger" role="progressbar" aria-label="Danger example" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Ka lawe ʻana i ka manaʻo i nā ʻenehana kōkua

ʻO ka hoʻohana ʻana i ke kala e hoʻohui i ka manaʻo e hāʻawi wale i kahi hōʻailona ʻike, ʻaʻole e hāʻawi ʻia i nā mea hoʻohana i nā ʻenehana kōkua - e like me nā mea heluhelu pale. E hōʻoia i ka ʻike i hōʻike ʻia e ka waihoʻoluʻu i ʻike ʻia mai ka maʻiʻo ponoʻī (e laʻa i ke kikokikona ʻike ʻia), a i ʻole e hoʻokomo ʻia ma o nā ala ʻē aʻe, e like me nā kikokikona hou i hūnā ʻia me ka .visually-hiddenpapa.

Nā pā he nui

E hoʻokomo i nā pahu holomua he nui i kahi ʻāpana holomua inā pono ʻoe.

html
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-label="Segment one" style="width: 15%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
  <div class="progress-bar bg-success" role="progressbar" aria-label="Segment two" style="width: 30%" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100"></div>
  <div class="progress-bar bg-info" role="progressbar" aria-label="Segment three" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
</div>

ʻōniʻoniʻo

Hoʻohui .progress-bar-stripedi kekahi .progress-bare hoʻopili i kahi kāʻei ma o CSS gradient ma luna o ke kala hope o ka pae holomua.

html
<div class="progress">
  <div class="progress-bar progress-bar-striped" role="progressbar" aria-label="Default striped example" style="width: 10%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar progress-bar-striped bg-success" role="progressbar" aria-label="Success striped example" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar progress-bar-striped bg-info" role="progressbar" aria-label="Info striped example" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar progress-bar-striped bg-warning" role="progressbar" aria-label="Warning striped example" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
  <div class="progress-bar progress-bar-striped bg-danger" role="progressbar" aria-label="Danger striped example" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Nā kaha ʻoniʻoni

Hiki ke hoʻolalelale ʻia ke kaha kaha kaha. Hoʻohui .progress-bar-animatedi .progress-bare hoʻolalelale i nā kaha ʻākau a hema ma o CSS3 animations.

html
<div class="progress">
  <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-label="Animated striped example" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
</div>

CSS

Nā mea hoʻololi

Hoʻohui ʻia ma v5.2.0

Ma ke ʻano o ka hoʻololi ʻana o nā ʻano hoʻololi CSS o Bootstrap, hoʻohana nā pae holomua i nā ʻano CSS kūloko .progressno ka hoʻomaikaʻi ʻana i ka manawa maoli. Hoʻonohonoho ʻia nā waiwai no nā ʻano CSS ma o Sass, no laila ke kākoʻo mau ʻia nei ka hana maʻamau Sass.

  --#{$prefix}progress-height: #{$progress-height};
  @include rfs($progress-font-size, --#{$prefix}progress-font-size);
  --#{$prefix}progress-bg: #{$progress-bg};
  --#{$prefix}progress-border-radius: #{$progress-border-radius};
  --#{$prefix}progress-box-shadow: #{$progress-box-shadow};
  --#{$prefix}progress-bar-color: #{$progress-bar-color};
  --#{$prefix}progress-bar-bg: #{$progress-bar-bg};
  --#{$prefix}progress-bar-transition: #{$progress-bar-transition};
  

Nā hoʻololi Sass

$progress-height:                   1rem;
$progress-font-size:                $font-size-base * .75;
$progress-bg:                       $gray-200;
$progress-border-radius:            $border-radius;
$progress-box-shadow:               $box-shadow-inset;
$progress-bar-color:                $white;
$progress-bar-bg:                   $primary;
$progress-bar-animation-timing:     1s linear infinite;
$progress-bar-transition:           width .6s ease;

Nā pahu kī

Hoʻohana ʻia no ka hana ʻana i nā animation CSS no .progress-bar-animated. Hoʻokomo ʻia i loko o scss/_progress-bar.scss.

@if $enable-transitions {
  @keyframes progress-bar-stripes {
    0% { background-position-x: $progress-height; }
  }
}