SteppedProgress

Lockness UI Component

VIEW

DOCUMENTATION

SteppedProgress

A segmented progress bar showing discrete steps. Useful for multi-step forms, onboarding flows, or displaying progress in stages.

Installation

bash
deno run -A jsr:@lockness/ui add steppedprogress

Usage

tsx
import { SteppedProgress } from '@lockness/ui/components'

// Basic usage (2 of 4 steps completed)
<SteppedProgress value={2} steps={4} />

// With end label (percentage at the end)
<SteppedProgress value={2} steps={4} endLabel />

// With inner label (step X of Y inside the bar)
<SteppedProgress value={2} steps={4} innerLabel thickness={6} />

// With checkmark when complete
<SteppedProgress value={4} steps={4} variant="success" showCheck />

Variants

tsx
<SteppedProgress value={2} steps={4} />
<SteppedProgress value={2} steps={4} variant="success" />
<SteppedProgress value={2} steps={4} variant="warning" />
<SteppedProgress value={2} steps={4} variant="destructive" />

Custom Thickness

tsx
// Thickness in Tailwind spacing units (1 = 0.25rem)
<SteppedProgress value={2} steps={4} thickness={1} />
<SteppedProgress value={2} steps={4} thickness={4} />

Striped Progress

tsx
// Static stripes
<SteppedProgress value={3} steps={5} striped />

// Animated stripes
<SteppedProgress value={3} steps={5} striped animated />

// With variant
<SteppedProgress value={3} steps={5} striped animated variant="success" />

Outlined Progress

tsx
// Outlined wrapper around the bar
<SteppedProgress value={3} steps={5} outlined />

// Outlined with variant
<SteppedProgress value={4} steps={5} outlined variant="success" />

// Combine with striped and animated
<SteppedProgress value={8} steps={10} outlined striped animated variant="success" thickness={4} />

Props

PropTypeDefaultDescription
valuenumber0Current step (1-based index)
stepsnumber4Total number of steps
variant'default' | 'success' | 'warning' | 'destructive''default'Visual style variant
thicknessnumber2.5Custom thickness in Tailwind spacing units
innerLabelbooleanfalseShow label inside the progress bar (step X of Y)
endLabelbooleanfalseShow percentage label at the end
showCheckbooleanfalseShow checkmark icon when complete
stripedbooleanfalseDisplay progress with diagonal stripes effect
animatedbooleanfalseAnimate the stripes (requires striped=true)
outlinedbooleanfalseAdd an outlined wrapper around the progress bar
classstring-Additional CSS class names
idstring-Element id attribute

Variants

VariantDescription
defaultPrimary color (uses --primary)
successTeal color for completed/successful states
warningYellow color for warning states
destructiveRed color for error/danger states

CSS Variables

SteppedProgress uses the same CSS variables as Progress, plus additional step-specific variables:

VariableDefaultDescription
--progress-border-radiusvar(--radius)Border radius of each segment
--progress-outline-border-width2pxBorder width for outlined wrapper
--progress-outline-padding0.25remPadding inside outlined wrapper
--progress-outline-border-radiuscalc(var(--radius) + 4px)Border radius for outlined wrapper
--progress-stripe-size1remSize of diagonal stripes
--progress-animation-duration1sDuration of stripe animation
--stepped-progress-step-size2remSize of step indicators
--stepped-progress-step-font-size0.875remFont size for step numbers
--stepped-progress-step-font-weight600Font weight for step numbers
--stepped-progress-connector-height2pxHeight of connecting line
--stepped-progress-connector-colorvar(--border)Color of connecting line
--stepped-progress-active-colorvar(--primary)Color of active step
--stepped-progress-inactive-colorvar(--muted)Color of inactive steps
--stepped-progress-completed-colorvar(--primary)Color of completed steps
--stepped-progress-label-font-size0.875remFont size for step labels
--stepped-progress-label-margin-top0.5remSpacing above step labels

Theming

The SteppedProgress component can be customized using CSS variables. Override these variables to match your design system.

Available CSS Variables

VariableDefaultDescription
--progress-border-radiusvar(--radius)Border radius of each segment
--progress-outline-border-width2pxBorder width for outlined wrapper
--progress-outline-padding0.25remPadding inside outlined wrapper
--progress-outline-border-radiuscalc(var(--radius) + 4px)Border radius for outlined wrapper
--progress-stripe-size1remSize of diagonal stripes
--progress-animation-duration1sDuration of stripe animation
--stepped-progress-step-size2remSize of step indicators
--stepped-progress-step-font-size0.875remFont size for step numbers
--stepped-progress-step-font-weight600Font weight for step numbers
--stepped-progress-connector-height2pxHeight of connecting line
--stepped-progress-connector-colorvar(--border)Color of connecting line
--stepped-progress-active-colorvar(--primary)Color of active step
--stepped-progress-inactive-colorvar(--muted)Color of inactive steps
--stepped-progress-completed-colorvar(--primary)Color of completed steps
--stepped-progress-label-font-size0.875remFont size for step labels
--stepped-progress-label-margin-top0.5remSpacing above step labels

Theming Examples

Custom Step Size and Typography

css
:root {
    --stepped-progress-step-size: 2.5rem;
    --stepped-progress-step-font-size: 1rem;
    --stepped-progress-step-font-weight: 700;
}

Custom Connector Style

css
:root {
    --stepped-progress-connector-height: 3px;
    --stepped-progress-connector-color: hsl(240 5% 80%);
}

.dark {
    --stepped-progress-connector-color: hsl(240 5% 30%);
}

Custom Step Colors

css
:root {
    --stepped-progress-active-color: hsl(220 90% 56%);
    --stepped-progress-inactive-color: hsl(240 5% 65%);
    --stepped-progress-completed-color: hsl(142 76% 36%);
}

.dark {
    --stepped-progress-active-color: hsl(220 90% 66%);
    --stepped-progress-inactive-color: hsl(240 5% 45%);
    --stepped-progress-completed-color: hsl(142 76% 46%);
}

Custom Label Style

css
:root {
    --stepped-progress-label-font-size: 1rem;
    --stepped-progress-label-margin-top: 0.75rem;
}

Complete Custom Theme

css
:root {
    /* Segment styling */
    --progress-border-radius: 0.5rem;

    /* Outline styling */
    --progress-outline-border-width: 1px;
    --progress-outline-padding: 0.375rem;
    --progress-outline-border-radius: 0.75rem;

    /* Stripe styling */
    --progress-stripe-size: 0.75rem;
    --progress-animation-duration: 1.5s;

    /* Step indicators */
    --stepped-progress-step-size: 3rem;
    --stepped-progress-step-font-size: 1rem;
    --stepped-progress-step-font-weight: 700;

    /* Connector */
    --stepped-progress-connector-height: 3px;
    --stepped-progress-connector-color: hsl(210 40% 85%);

    /* Colors */
    --stepped-progress-active-color: hsl(262 83% 58%);
    --stepped-progress-inactive-color: hsl(240 5% 70%);
    --stepped-progress-completed-color: hsl(160 60% 45%);

    /* Labels */
    --stepped-progress-label-font-size: 1rem;
    --stepped-progress-label-margin-top: 1rem;
}

.dark {
    --stepped-progress-connector-color: hsl(210 40% 25%);
    --stepped-progress-active-color: hsl(262 83% 68%);
    --stepped-progress-inactive-color: hsl(240 5% 40%);
    --stepped-progress-completed-color: hsl(160 60% 55%);
}

Features

  • Segmented display - Shows progress as discrete steps
  • Multiple label options - Inner label or end label
  • Checkmark completion - Optional checkmark when 100%
  • Striped effect - Diagonal stripes with optional animation
  • Outlined wrapper - Border wrapper with padding
  • Customizable thickness - Control segment height
  • Fully customizable - CSS variables for theming
  • Accessible - Proper ARIA attributes for each segment

BASIC USAGE

2
3
4
3
4
4
tsx
import { SteppedProgress } from '@lockness/ui/components'

<SteppedProgress value={2} steps={4} />

DIFFERENT NUMBER OF STEPS

3 steps

2
3

5 steps

3
4
5

7 steps

5
6
7

10 steps

7
8
9
10
tsx
<SteppedProgress value={2} steps={3} />
<SteppedProgress value={3} steps={5} />
<SteppedProgress value={5} steps={7} />
<SteppedProgress value={7} steps={10} />

WITH END LABEL

1
2
3
4
25%
2
3
4
50%
3
4
75%
4
100%
tsx
<SteppedProgress value={2} steps={4} endLabel />

WITH INNER LABEL

1
2
3
4
2
3
4
3
4
4
tsx
<SteppedProgress value={2} steps={4} innerLabel />

INNER LABEL WITH CUSTOM THICKNESS

3
4
5
7
8
9
10
tsx
<SteppedProgress value={3} steps={5} innerLabel thickness={8} />

WITH CHECKMARK WHEN COMPLETE

10
4
tsx
<SteppedProgress value={10} steps={10} variant="success" showCheck />

VARIANTS

2
3
4
50%
1
2
3
4
25%
3
4
75%
4
tsx
<SteppedProgress value={1} steps={4} variant="destructive" endLabel />

CUSTOM THICKNESS

2
3
4
2
3
4
2
3
4
tsx
<SteppedProgress value={2} steps={4} thickness={4} />

STRIPED PROGRESS

2
3
4
3
4
5
5
6
7
tsx
<SteppedProgress value={3} steps={5} striped />

STRIPED ANIMATED PROGRESS

2
3
4
3
4
5
5
6
7
tsx
<SteppedProgress value={3} steps={5} striped animated variant="success" />

OUTLINED PROGRESS

2
3
4
3
4
5
5
6
7
8
9
10
tsx
<SteppedProgress value={3} steps={5} outlined />

OUTLINED PROGRESS VARIANTS

3
4
5
4
5
2
3
4
5
1
2
3
4
5
tsx
<SteppedProgress value={4} steps={5} outlined variant="success" />

OUTLINED MANY STEPS (SUCCESS)

8
9
10
11
12
15
16
17
18
19
20
tsx
<SteppedProgress value={15} steps={20} outlined striped animated variant="success" thickness={4} />

OUTLINED STRIPED ANIMATED (LARGE)

3
4
5
5
6
7
8
9
10
12
13
14
15
tsx
<SteppedProgress
  value={8}
  steps={10}
  outlined
  striped
  animated
  thickness={4}
  variant="success"
/>