Téigh ar aghaidh chuig an bpríomhábhar Scipeáil chuig nascleanúint docs
in English

Dul chun cinn

Doiciméadú agus samplaí chun barraí dul chun cinn saincheaptha Bootstrap a úsáid ina bhfuil tacaíocht do bharraí cruachta, cúlraí beoite, agus lipéid téacs.

Conas a oibríonn sé

Tógtar comhpháirteanna dul chun cinn le dhá eilimint HTML, roinnt CSS chun an leithead a shocrú, agus cúpla tréithe. Ní úsáidimid an eilimint HTML5<progress> , ag cinntiú gur féidir leat barraí dul chun cinn a chruachadh, iad a bheochan agus lipéid téacs a chur os a gcionn.

  • Bainimid úsáid as .progressmar fhillteán chun uasluach an bharra dul chun cinn a léiriú.
  • Bainimid úsáid as an taobh istigh .progress-barchun an dul chun cinn go dtí seo a chur in iúl.
  • Teastaíonn .progress-barstíl inlíne, rang fóntais, nó CSS ​​saincheaptha chun a leithead a shocrú.
  • Teastaíonn .progress-barroinnt roleagus ariatréithe freisin chun é a dhéanamh inrochtana.

Cuir é sin go léir le chéile, agus tá na samplaí seo a leanas agat.

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

Soláthraíonn Bootstrap dornán fóntais chun leithead a shocrú . Ag brath ar do chuid riachtanas, d’fhéadfadh go gcuideodh siad seo le dul chun cinn a chumrú go tapa.

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

Lipéid

Cuir lipéid le do bharraí dul chun cinn trí théacs a chur laistigh den .progress-bar.

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

Airde

Ní shocraíomar ach heightluach ar an .progress, mar sin má athraíonn tú an luach sin athróidh an taobh istigh .progress-bargo huathoibríoch dá réir.

<div class="progress" style="height: 1px;">
  <div class="progress-bar" role="progressbar" 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" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Cúlra

Úsáid ranganna áirgiúlachta cúlra chun cuma barraí dul chun cinn aonair a athrú.

<div class="progress">
  <div class="progress-bar bg-success" role="progressbar" 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" 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" 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" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Barraí iolracha

Cuir barraí dul chun cinn iolracha i gcomhpháirt dul chun cinn más gá.

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

Striped

Cuir .progress-bar-stripedle haon cheann .progress-barchun stríoc a chur i bhfeidhm trí ghrádán CSS thar dhath cúlra an bharra dul chun cinn.

<div class="progress">
  <div class="progress-bar progress-bar-striped" role="progressbar" 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" 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" 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" 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" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Stripes beoite

Is féidir an grádán stríocach a bheochan freisin. Cuir .progress-bar-animatedleis .progress-barchun na stríoca a bheochan ó dheas go clé trí bheochan CSS3.

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

Sass

Athróga

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

Frámaí eochair

Úsáidte chun beochan CSS a chruthú le haghaidh .progress-bar-animated. San áireamh i scss/_progress-bar.scss.

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