Laktawan ti kangrunaan a linaon Laktawan ti docs navigation
Check
in English

Pagannayasan

Dokumentasion ken dagiti pagarigan para iti panagusar kadagiti kostumbre a bara ti panagrang-ay ti Bootstrap a mangitampok ti suporta para kadagiti naurnong a bara, dagiti animado a likudan, ken dagiti etiketa ti teksto.

No kasano ti panagandar dayta

Dagiti paset ti panagrang-ay ket naibangon babaen dagiti dua nga elemento ti HTML, dagiti sumagmamano a CSS tapno mangikeddeng ti kalawa, ken sumagmamano a kababalin. Saanmi nga usaren ti elemento ti HTML5<progress> , a mangsigurado a mabalinmo nga agtumpok kadagiti bara ti panagrang-ay, mang-animate kadagitoy, ken mangikabil kadagiti etiketa ti teksto iti rabaw dagitoy.

  • Usarenmi ti .progressas a wrapper tapno mangipakita ti max value ti progress bar.
  • Usarentayo ti makin -uneg .progress-bara mangipakita iti panagrang-ay agingga ita.
  • Ti .progress-barkasapulan ti inline nga estilo, klase ti utilidad, wenno kostumbre a CSS tapno mangikeddeng ti kalawada.
  • Ti .progress-barpay ket agkasapulan kadagiti sumagmamano roleken ariadagiti kababalin tapno agbalin a makastrek, a mairaman ti maysa a mabalin a makastrek a nagan (nga agus -usar ti aria-label, aria-labelledby, wenno kapada).

Pagtitiponem amin dayta, ket addaanka kadagiti sumaganad a pagarigan.

html nga
<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>

Ti Bootstrap ket mangipaay ti sumagmamano a utilidad para iti panangisaad ti kalawa . Depende kadagiti kasapulam, dagitoy ket mabalin a makatulong iti napardas a panangikonfigura ti panagrang-ay.

html nga
<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>

Dagiti etiketa

Manginayon kadagiti etiketa kadagiti bara ti panagrang-aymo babaen ti panangikabil ti teksto iti uneg ti .progress-bar.

25% nga .
html nga
<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>

Kinatayag

Mangikeddengkami laeng iti heightpateg iti .progress, isu a no baliwam dayta a pateg ti makin -uneg .progress-barket automatiko a mangbalbaliw iti kadakkel a maitunos.

html nga
<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>

Dagiti Background

Usaren dagiti klase ti utilidad ti likudan tapno baliwan ti langa dagiti indibidual a bara ti panagrang-ay.

html nga
<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>
Panangipaay ti kaipapanan kadagiti makatulong a teknolohia

Ti panagusar ti kolor tapno mangnayon ti kaipapanan ket mangipaay laeng ti makita a pakakitaan, a saan a maidanon kadagiti agar-aramat kadagiti makatulong a teknolohia – kas dagiti screen reader. Siguraduen a ti impormasion a naipasimudaag babaen ti kolor ket nalawag manipud iti linaon a mismo (kas pagarigan ti makita a teksto), wenno mairaman babaen dagiti alternatibo a wagas, a kas ti kanayonan a teksto a nailemmeng a kadua ti .visually-hiddenklase.

Adu a bara

Iraman ti adu a progress bar iti maysa a progress component no kasapulam.

html nga
<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>

Garitgaritan

Inayon .progress-bar-stripediti ania man .progress-bartapno maipakat ti garit babaen ti CSS a panagrang-ay iti rabaw ti kolor ti likudan ti bara ti panagrang-ay.

html nga
<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>

Animado nga mga garit

Mabalin met nga animated ti striped gradient. Inayon .progress-bar-animatediti .progress-bartapno mapabiag dagiti garit iti kannawan agingga iti kannigid babaen dagiti animasion ti CSS3.

html nga
<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 nga

Dagiti Variable

Nainayon iti v5.2.0

Kas paset ti agbaliwbaliw nga asidegan dagiti CSS a variable ti Bootstrap, dagiti bara ti panagrang-ay ket agus-usar itan kadagiti lokal a CSS a variable iti .progresspara iti napasayaat nga aktual nga oras a panagpasayaat. Dagiti pateg para kadagiti variable ti CSS ket naikeddeng babaen ti Sass, isu a ti panagpasayaat ti Sass ket nasuportaran pay laeng, met.

  --#{$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};
  

Sass dagiti variable

$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;

Dagiti Keyframe

Nausar para iti panagpartuat kadagiti animasion ti CSS para iti .progress-bar-animated. Nairaman iti scss/_progress-bar.scss.

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