JSFiddle - React, Tailwind, and code Playground

HTML

<div id="progress"></div>
<br/><span id="loadingpro"></span>

CSS

div { 
    background-color: #0000FF; 
    width:1px;
    height:100px;}

JavaScript

$(function() {
        var timer = setInterval(function() {
            $("#loadingpro").html(Math.round($("#progress").width()/4) + "%");
        },20);
        $("#progress").animate({width:400},2000, function() {
            clearInterval(timer);
        });
    });