cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!--
Modify just data-current-step and data-step-status values to change progressbar status.
-->

<div class="container">
    <h2>Stepbar v0.1</h2>
    <h4>Fully resizable, dynamic Multi-step progress bar using Glyphicons from Bootstrap.</h4>
    <table class="stepbar-progress" data-current-step="1" data-step-status="pending">
        <caption>First Step Pending</caption>
        <tbody>
            <tr>
                <td class="step-item step-item-first" data-step="1">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-middle" data-step="2">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-last" data-step="3">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="stepbar-progress" data-current-step="2" data-step-status="active">
        <caption>Second Step Active</caption>
        <tbody>
            <tr>
                <td class="step-item step-item-first" data-step="1">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-middle" data-step="2">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-last" data-step="3">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="stepbar-progress" data-current-step="2" data-step-status="fail">
        <caption>Second Step FAILED</caption>
        <tbody>
            <tr>
                <td class="step-item step-item-first" data-step="1">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-middle" data-step="2">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-last" data-step="3">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="stepbar-progress" data-current-step="2" data-step-status="pass">
        <caption>Second Step Passed</caption>
        <tbody>
            <tr>
                <td class="step-item step-item-first" data-step="1">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-middle" data-step="2">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-last" data-step="3">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="stepbar-progress" data-current-step="3" data-step-status="pending">
        <caption>Last Step Pending</caption>
        <tbody>
            <tr>
                <td class="step-item step-item-first" data-step="1">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-middle" data-step="2">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-last" data-step="3">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="stepbar-progress" data-current-step="3" data-step-status="pass">
        <caption>All Steps Passed</caption>
        <tbody>
            <tr>
                <td class="step-item step-item-first" data-step="1">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-middle" data-step="2">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
                <td class="step-item-progress">
                    <span class="progress-body">
                        <span class="body-fill"></span>
                    </span>
                </td>
                <td class="step-item step-item-last" data-step="3">
                    <span class="step-body">
                        <span class="glyphicon"></span>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
</div>
            
          
!
            
              /**
 * Stepbar
 *
 * Step Bar Progress Bar for Bootstrap.
 *
 * Author: Kushal Pandya <kushalspandya@gmail.com> (https://doublslash.com)
 * Date: 1 December, 2015
 */

$light_gray: #E4E4E7;

$step-count: 3;

$step-states: 
    "pending",
    "active",
    "pass",
    "fail";

$state-to-glyph: (
    pending: "\e234",
    active: "\e031",
    pass: "\e013",
    fail: "\e101"
);

$state-to-color: (
    pending: #F8AC59,
    active: #1C84C6,
    pass: #1AB394,
    fail: #ED5565
);

@keyframes active-spin {
    from {transform: rotate(0deg);}
    to {transform: rotate(360deg);}
}

.container {
    margin-top: 20px;
    
    h2 {
        text-align: center;
    }
    
    h4 {
        color: #999;
        text-align: center;
    }
    
    .stepbar-progress {
        margin-top: 30px;
    }
}

.stepbar-progress {
    width: 100%;
    height: 32px;
    border-collapse: collapse;
        
    .step-item {
        width: 32px;
        
        .step-body {
            position: relative;
            display: block;
            width: 32px;
            height: 32px;
            background-color: $light_gray;
            border: 5px solid $light_gray;
            border-radius: 50%;
            
            .glyphicon:before {
                color: white;
                margin: auto 4px 0 4px;
                line-height: 20px;
            }
        }
    }
    
    .step-item-progress {
        width: 100% / ($step-count - 1);
        height: 32px;
        verticle-align: middle;
        
        .progress-body {
            display: block;
            height: 11px;
            background-color: $light_gray;
            border-top: 3px solid $light_gray;
            border-bottom: 3px solid $light_gray;

            background-image: -webkit-linear-gradient(
                                -45deg,
                                rgba(255, 255, 255, .3) 0%, transparent 5%,
                                rgba(255, 255, 255, .3) 10%, transparent 15%,
                                rgba(255, 255, 255, .3) 20%, transparent 25%,
                                rgba(255, 255, 255, .3) 30%, transparent 35%,
                                rgba(255, 255, 255, .3) 40%, transparent 45%,
                                rgba(255, 255, 255, .3) 50%, transparent 55%,
                                rgba(255, 255, 255, .3) 60%, transparent 65%,
                                rgba(255, 255, 255, .3) 70%, transparent 75%,
                                rgba(255, 255, 255, .3) 80%, transparent 85%,
                                rgba(255, 255, 255, .3) 90%, transparent 95%,
                                rgba(255, 255, 255, .3) 100%
                              );

            background-image: -moz-linear-gradient(
                                -45deg,
                                rgba(255, 255, 255, .3) 0%, transparent 5%,
                                rgba(255, 255, 255, .3) 10%, transparent 15%,
                                rgba(255, 255, 255, .3) 20%, transparent 25%,
                                rgba(255, 255, 255, .3) 30%, transparent 35%,
                                rgba(255, 255, 255, .3) 40%, transparent 45%,
                                rgba(255, 255, 255, .3) 50%, transparent 55%,
                                rgba(255, 255, 255, .3) 60%, transparent 65%,
                                rgba(255, 255, 255, .3) 70%, transparent 75%,
                                rgba(255, 255, 255, .3) 80%, transparent 85%,
                                rgba(255, 255, 255, .3) 90%, transparent 95%,
                                rgba(255, 255, 255, .3) 100%
                              );

            background-image: -ms-linear-gradient(
                                -45deg,
                                rgba(255, 255, 255, .3) 0%, transparent 5%,
                                rgba(255, 255, 255, .3) 10%, transparent 15%,
                                rgba(255, 255, 255, .3) 20%, transparent 25%,
                                rgba(255, 255, 255, .3) 30%, transparent 35%,
                                rgba(255, 255, 255, .3) 40%, transparent 45%,
                                rgba(255, 255, 255, .3) 50%, transparent 55%,
                                rgba(255, 255, 255, .3) 60%, transparent 65%,
                                rgba(255, 255, 255, .3) 70%, transparent 75%,
                                rgba(255, 255, 255, .3) 80%, transparent 85%,
                                rgba(255, 255, 255, .3) 90%, transparent 95%,
                                rgba(255, 255, 255, .3) 100%
                              );

            background-image: -o-linear-gradient(
                                -45deg,
                                rgba(255, 255, 255, .3) 0%, transparent 5%,
                                rgba(255, 255, 255, .3) 10%, transparent 15%,
                                rgba(255, 255, 255, .3) 20%, transparent 25%,
                                rgba(255, 255, 255, .3) 30%, transparent 35%,
                                rgba(255, 255, 255, .3) 40%, transparent 45%,
                                rgba(255, 255, 255, .3) 50%, transparent 55%,
                                rgba(255, 255, 255, .3) 60%, transparent 65%,
                                rgba(255, 255, 255, .3) 70%, transparent 75%,
                                rgba(255, 255, 255, .3) 80%, transparent 85%,
                                rgba(255, 255, 255, .3) 90%, transparent 95%,
                                rgba(255, 255, 255, .3) 100%
                              );

            background-image: linear-gradient(
                                -45deg,
                                rgba(255, 255, 255, .3) 0%, transparent 5%,
                                rgba(255, 255, 255, .3) 10%, transparent 15%,
                                rgba(255, 255, 255, .3) 20%, transparent 25%,
                                rgba(255, 255, 255, .3) 30%, transparent 35%,
                                rgba(255, 255, 255, .3) 40%, transparent 45%,
                                rgba(255, 255, 255, .3) 50%, transparent 55%,
                                rgba(255, 255, 255, .3) 60%, transparent 65%,
                                rgba(255, 255, 255, .3) 70%, transparent 75%,
                                rgba(255, 255, 255, .3) 80%, transparent 85%,
                                rgba(255, 255, 255, .3) 90%, transparent 95%,
                                rgba(255, 255, 255, .3) 100%
                              );

            transition: all 1s ease;
            
            .body-fill {
                width: 20px;
                height: 5px;
                background-color: #1AB394;
            }
        }
    }
    
    .step-item-first .step-body:after,
    .step-item-middle .step-body:after,
    .step-item-middle .step-body:before,
    .step-item-last .step-body:before {
        content: "";
        position: absolute;
        top: calc(50% - 6px);
        height: 11px;
        width: 6px;
        background-color: $light_gray;
        border-top: 3px solid $light_gray;
        border-bottom: 3px solid $light_gray;
    }

    .step-item-first,
    .step-item-middle {
         .step-body:after {
            left: 100%;
        }
    }
    
    .step-item-middle,
    .step-item-last {
         .step-body:before {
            right: 100%;
        }
    }
}

.stepbar-progress {
    
    @mixin step-status($step: "1", $status-color: #E4E4E7, $status-icon: '', $animate: false) {
        .step-item[data-step="#{$step}"] .step-body {
            background-color: $status-color;
            
            .glyphicon {
                @if $animate == true {
                    animation: active-spin infinite 1s linear;
                }
                
                &:before {
                    content: $status-icon;
                }
            }
        }
    }
    
    @mixin fill-step-progress($from-step, $to-step, $status-color: #E4E4E7) {
        .step-item[data-step="#{$from-step}"] .step-body:after,
        .step-item[data-step="#{$from-step}"]  + .step-item-progress .progress-body,
        .step-item[data-step="#{$to-step}"] .step-body:before {
            background-color: $status-color;
        }
    }
    
    /* Individual Steps */
    @each $state in $step-states {
        $animate-glyphicon: $state == "active";
        $state-pass-glyph: map-get($state-to-glyph, "pass");
        $current-state-color: map-get($state-to-color, $state);
        $current-state-glyph: map-get($state-to-glyph, $state);

        // Upto step 1
        &[data-current-step="1"][data-step-status="#{$state}"] {
            @include step-status('1', $current-state-color, $current-state-glyph, $animate-glyphicon);
        }
        
        // Upto step 2
        &[data-current-step="2"][data-step-status="#{$state}"] {
            @include step-status('1', $current-state-color, $state-pass-glyph);
            @include step-status('2', $current-state-color, $current-state-glyph, $animate-glyphicon);
            @include fill-step-progress('1', '2', $current-state-color);
        }
        
        // Upto step 3
        &[data-current-step="3"][data-step-status="#{$state}"] {
            @include step-status('1', $current-state-color, $state-pass-glyph);
            @include step-status('2', $current-state-color, $state-pass-glyph);
            @include step-status('3', $current-state-color, $current-state-glyph, $animate-glyphicon);
            @include fill-step-progress('1', '2', $current-state-color);
            @include fill-step-progress('2', '3', $current-state-color);
        }
    }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console