I want a stacked progress bar tracking two fields:
valueBuffer
: amount unlocked out of total. The light blue bar.value
: amount claimed out of unlocked. The dark blue bar.
Variant buffered
suits my use case but the dotted line animation is annoying. How do I disable the animation and replace it with a regular bar?
<LinearProgress variant="buffer" value={50} valueBuffer={70} />
If this is not possible, what is the alternative to have a
CodePudding user response:
You can use add a custom style to .MuiLinearProgress-dashed
and modify the default dashed styles using sx
attribute like this:
<LinearProgress
variant="buffer"
value={progress}
valueBuffer={buffer}
sx={{
"& .MuiLinearProgress-dashed": {
backgroundColor: "lightgrey",
backgroundImage: "none",
animation: "none"
}
}}
/>
You can take a look at this sandbox for a live working example of this solution.