Featured image for Responsive horizontal step indicator in Bootstrap 5.3

Responsive horizontal step indicator in Bootstrap 5.3

25/10/2025 · Code Snippets

Creating a clean, responsive step indicator is a common requirement in multi-step forms, onboarding flows, and checkout processes. Bootstrap 5.3 makes this simple to implement with modern Flexbox utilities and custom styling.

Below is a fully responsive horizontal step indicator that works seamlessly with Bootstrap 5.3. It visually represents progress through steps, with clear differentiation between completed, active, and upcoming steps.

Demo – Stepper with bootstrap

1
Step 1
2
Step 2
3
Step 3
4
Step 4

How It Works

  • The .stepper container uses display: flex for a responsive horizontal layout.
  • Each .step represents a single progress point and flexes evenly across the container.
  • The ::before pseudo-element creates the connecting line between steps.
  • The .completed and .active classes dynamically change the step’s color and status, making it visually clear which steps are done and which one is currently active.

The HTML code

<div class="stepper">
    <div class="step completed">
        <div class="step-number">1</div>
        <div class="step-label">Step 1</div>
    </div>
    <div class="step completed">
        <div class="step-number">2</div>
        <div class="step-label">Step 2</div>
    </div>
    <div class="step active">
        <div class="step-number">3</div>
        <div class="step-label">Step 3</div>
    </div>
    <div class="step">
        <div class="step-number">4</div>
        <div class="step-label">Step 4</div>
    </div>
</div>

The CSS code

.stepper {
display: flex;
justify-content: space-between;
position: relative;
margin: 40px 0;
}

.step {
text-align: center;
position: relative;
flex: 1;
}

.step::before {
content: '';
position: absolute;
top: 20px;
left: 50%;
transform: translateX(-50%);
height: 4px;
width: 100%;
background-color: var(--bs-secondary);
z-index: 0;
}

.step-number {
position: relative;
z-index: 1;
display: inline-block;
width: 40px;
height: 40px;
line-height: 40px;
border-radius: 50%;
background-color: var(--bs-secondary);
color: var(--bs-light);
font-weight: 600;
}

.step.active .step-number {
background-color:  var(--bs-primary);
color: var(--bs-light);
}

.step.completed .step-number {
background-color:  var(--bs-success);
color: var(--bs-light);
}

.step-label {
margin-top: 10px;
font-size: 0.9rem;
color: var(--bs-secondary);
}

.step.active .step-label {
color:  var(--bs-primary);
font-weight: 600;
}

Who’s the dev?

Code Snippet by
@mike  •  Mike C.


I’ve been a web designer/developer for 20+ years. "Coffee in, code out." I love tinkering with WordPress, Photoshop, Blender, Bootstrap, and AI. I split my time between France and the Netherlands. When I’m off the clock, I enjoy creating assets and mods for video games like Ark, Cities: Skylines, and The Sims.

alox.co


Join the conversation


You must be logged in to comment.
Login or register for a free account now!
Alox & Co

Login



Not yet a member?

Create your free account today and start a new adventure!

Register