<div id="progressBars" class="hx-flag-typography"></div>
hx.select('#progressBars').set([
hx.div('hx-header-small').text('Standard Progress Bar'),
hx.progressBar({
featureFlags: { useUpdatedClass: true },
title: 'Title here',
breakdown: 'Breakdown Text can go here',
plan: 78,
done: 38,
}),
hx.div('spacer-for-docs hx-pad hx-margin'),
hx.div('hx-header-small').text('Compact Progress Bar'),
hx.progressBar({
featureFlags: { useUpdatedClass: true },
title: 'Freezer (eaches)',
breakdown: 'Breakdown Text can go here',
plan: 78,
done: 38,
compact: true,
}),
]);
<div class="hx-header-medium">ProgressBarV1</div>
<div id="pb1" class="hx-progress-bar"></div>
<div id="pb2" class="hx-progress-bar hx-positive"></div>
<div id="pb3" class="hx-progress-bar hx-warning"></div>
<div id="pb4" class="hx-progress-bar hx-negative"></div>
<div id="pb5" class="hx-progress-bar hx-info"></div>
<div id="pb6" class="hx-progress-bar hx-complement"></div>
<div id="pb7" class="hx-progress-bar hx-contrast"></div>
new hx.ProgressBar('#pb1', {value: 0.25})
new hx.ProgressBar('#pb2', {value: 0.33})
new hx.ProgressBar('#pb3', {value: 0.42})
new hx.ProgressBar('#pb4', {value: 0.5})
new hx.ProgressBar('#pb5', {value: 0.58})
new hx.ProgressBar('#pb6', {value: 0.67})
new hx.ProgressBar('#pb7', {value: 0.75})
ProgressBarV2
.
Pass featureFlags.useUpdatedClass: true
in the constructor options to create a new style progress bar. hx.ProgressBar
[
{ // Segment would be 25% of the total size of the progress bar and positive
"class": "hx-positive"
"value": 0.25
},
{ // Segment would be 75% of the total size of the progress bar
"value": 0.75
}
]
[
{
"class": "hx-negative"
"ratio": 3
}
{
"class": "hx-warning"
}
{
"class": "hx-positive"
"ratio": 1
}
]
hx.ProgressBar
with the featureFlags.useUpdatedClass: true
option. undefined
false
false
progress / plan
(e.g. 100 / 1200
)
The done
amount can be greater than the planned amount (e.g. when you have completed more than you planned to complete) 0
false
0
progress / plan
(e.g. 100 / 1200
0
undefined
ProgressBarV1
and ProgressBarV2
.
By default, this will create a ProgressBarV1
. If passing featureFlags.useUpdatedClass: true
in the options, a ProgressBarV2
will be created. ProgressBarV1
. If passing featureFlags.useUpdatedClass: true
in the options, a ProgressBarV2
will be created.