N
Nuxt3mo ago
Uchuu

How can I make UProgress update its fill smoothly instead of every few steps?

<UProgress v-model="currentIndex" :max="moduleData.Questions.length"/> the :max is 320 and the bar only updates its progress every few currentIndex updates, not with each currentindex update
5 Replies
kapa.ai
kapa.ai3mo ago
Hi @Uchuu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The behavior you're describing—where the UProgress bar only updates its fill every few steps instead of smoothly with each currentIndex update—can occur if the :max prop is set to a large number (like 320), making each increment a very small percentage change. The progress bar's visual update may appear "stepped" or less smooth, especially if the bar's width in pixels is not enough to show each tiny increment. Based on the documentation, UProgress updates its fill according to the value of v-model relative to max. If max is 320, each increment of currentIndex increases the progress by about 0.3125%. On screens with limited width, this may not be visually noticeable for each step. How to make the progress bar update smoothly: - The UProgress component does not provide a built-in "smoothing" or animation for each value change beyond the default transition. The smoothness is determined by the ratio of v-model to max and the width of the bar. - If you want to see a smoother, more continuous fill, you could: - Reduce the max value (if possible for your use case). - Increase the width of the progress bar so that each increment is more visually apparent. - Optionally, you could interpolate the value in your code (e.g., animate the value from the previous to the new currentIndex), but the documentation does not provide a built-in prop for this. The UProgress component does have a transition on the indicator by default (transition-transform duration-200 ease-out), but it will only animate the change between the old and new value. If the value change is too small to be visually significant, it may appear as if the bar is not updating smoothly. There is no documented prop to change the interpolation or add finer-grained animation for small increments in the official docs:
Use the v-model directive to control the value of the Progress.
...
The progress value. Can be bind as v-model.
...
indicator: 'rounded-full size-full transition-transform duration-200 ease-out'
UProgress Theme
UProgress Usage
Summary:
UProgress updates its fill based on the ratio of v-model to max, with a default transition. If you need smoother visual updates for a large max value, you may need to implement a custom animation/interpolation in your component logic, as there is no built-in prop for this in the current documentation. If you need an example of how to animate the value in your own code, let me know! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@1035470271441805353> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Uchuu
UchuuOP3mo ago
@kapa.ai If you need an example of how to animate the value in your own code, let me know! Do this
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I'm sorry, but the knowledge sources do not provide an example or official guidance on how to animate the value for UProgress in your own code beyond the default transition that is already applied to the indicator (see theme config). The documentation only covers using v-model to control the value, and does not include any custom interpolation or animation logic for smoother updates between values UProgress Usage. If you need more advanced animation (such as animating the value from the previous to the new value), you would need to implement this yourself, but unfortunately, the knowledge sources do not contain an example or recommended approach for this scenario. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@1035470271441805353> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?