All progress components can be configured using data attributes. There are two ways:
Precedence: JavaScript options passed to the constructor override individual attributes, which override `data-bs-config`, which override the defaults.
data-bs-stroke-width
(Circular only): Sets the stroke width in pixels (default: 15
).data-bs-size
(Circular only): Sets the size in pixels (default: 120
).data-bs-duration
: Animation duration in milliseconds (default: 1500
).data-bs-delay
: Delay before animation starts in milliseconds (default: 0
).data-bs-animation
: Enables animation (default: true
). Set to `false` or omit the attribute to disable.data-bs-animate-in-viewport
: Only animate when the element enters the viewport (default: true
). Set to `false` to disable.Note: For boolean attributes like data-bs-animation
, simply adding the attribute implies true
. You only need to add `="false"` to explicitly disable it.
Bootstrap Progress Bar Extension were built with accessibility in mind:
role="progressbar"
, aria-valuenow
, aria-valuemin
, aria-valuemax
, and aria-label
attributesprefers-reduced-motion
browser setting. When enabled, animations will be disabled automatically for users who prefer reduced motiondir="rtl"
attribute<div class="progress" role="progressbar" aria-label="Basic example"
aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
data-bs-animation>
<div class="progress-bar"></div>
</div>
<div class="progress circular" role="progressbar" aria-label="Circular progress"
aria-valuenow="45" aria-valuemin="0" aria-valuemax="100"
data-bs-stroke-width="8"
data-bs-animation>
<div class="progress-bar">
<div class="progress-label">45%</div>
</div>
</div>
<!-- Combined RTL and Size Configuration -->
<div dir="rtl">
<div class="progress circular" role="progressbar" aria-label="Large RTL Example"
aria-valuenow="70" aria-valuemin="0" aria-valuemax="100"
data-bs-size="150"
data-bs-stroke-width="10"
data-bs-animation>
<div class="progress-bar bg-info">
<div class="progress-label">٧٠٪</div>
</div>
</div>
</div>
<div class="progress circular" role="progressbar" aria-label="No Animation Example"
aria-valuenow="85" aria-valuemin="0" aria-valuemax="100"
data-bs-stroke-width="12"
data-bs-animation="false"> <!-- Explicitly false -->
<div class="progress-bar bg-warning">
<div class="progress-label">85%</div>
</div>
</div>
<!-- Example using the data-bs-config JSON attribute -->
<div class="progress circular" role="progressbar" aria-label="JSON Config Example"
aria-valuenow="30" aria-valuemin="0" aria-valuemax="100"
data-bs-config='{
"strokeWidth": 18,
"size": 140,
"duration": 2200,
"delay": 300,
"animation": true
}'>
<div class="progress-bar bg-secondary">
<div class="progress-label">30%</div>
</div>
</div>