Stepper
Multi-step form wizard navigation headers, vertical workflow progression, and compact capsule steppers for structured citizen workflows
The UX4G Stepper component guides citizens through multi-step forms, verification procedures, and onboarding sequences. It provides structured progress feedback through standard full-width steppers and mobile-optimized compact capsule layouts.
Key Capabilities
- Standard Stepper Layouts: Supports
Horizontal(center-line or bottom-line track) andVerticalorientations with customizable line styles (Solid,Dashed). - Compact Capsule Steppers: Space-efficient mobile stepper (
Ux4gCompactStepper) featuring pill indicators with 5 layout arrangements (Linear,RightAligned,Centered,CenteredBetween,Split). - Detailed Step Metadata: Supports individual step titles, subtitles, status tags (e.g., "Completed", "In progress"), and error states (
Ux4gStepItem). - Interactive Navigation: Integrated previous/next arrow button controls with automatic boundary disabling.
Import from com.ux4g.designsystemv1.components.steppers.*.
Interactive Previews
1. Horizontal Stepper (Center Line)
Standard horizontal progress stepper with centered connector lines linking numbered and checkmark indicator circles.

2. Horizontal Stepper (Error State)
Horizontal stepper displaying a validation error state on a previously completed step with an exclamation indicator and red review prompt.

3. Horizontal Stepper (Bottom Line)
Horizontal stepper variant where the continuous progress indicator line runs beneath the step labels and descriptions.

4. Vertical Stepper
Vertical layout ideal for side navigation rails, long multi-section citizen applications, and mobile forms.

5. Compact Stepper (Linear)
Compact capsule stepper with previous/next navigation buttons flanking the top pill row, and left-aligned step counter and descriptions.

6. Compact Stepper (Right Aligned)
Compact capsule stepper variant where the step title and description are aligned to the right, balanced against the step count on the left.

7. Compact Stepper (Centered Split)
Centered compact stepper with top progress capsules, middle step count, and centered title/description flanked by circular navigation buttons.

Kotlin Usage
1. Multi-Step Citizen Application Wizard
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.ux4g.designsystemv1.components.steppers.*
@Composable
fun CitizenRegistrationWizard(currentStepIndex: Int) {
val steps = remember {
listOf(
Ux4gStepItem(
title = "Applicant Details",
description = "Name, DOB, & Gender",
statusLabel = "Completed"
),
Ux4gStepItem(
title = "Address & Domicile",
description = "Permanent Address Verification",
statusLabel = "In progress"
),
Ux4gStepItem(
title = "Income & Caste",
description = "Certificates Upload",
statusLabel = "Pending"
),
Ux4gStepItem(
title = "Review & Submit",
description = "Final e-Sign Verification",
statusLabel = "Pending"
)
)
}
Ux4gStepper(
totalSteps = 4,
currentStep = currentStepIndex,
steps = steps,
orientation = StepperOrientation.Horizontal,
linePlacement = StepperLinePlacement.Center,
modifier = Modifier.fillMaxWidth().padding(16.dp)
)
}2. Mobile Compact Capsule Stepper
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.ux4g.designsystemv1.components.steppers.*
@Composable
fun MobileOnboardingFlow() {
var step by remember { mutableIntStateOf(1) }
val stepLabels = listOf(
"Mobile Verification" to "Enter 6-digit OTP",
"PAN Verification" to "Enter 10-digit PAN",
"Bank Account" to "IFSC and Account No",
"Set MPIN" to "Choose 4-digit Security PIN"
)
val currentInfo = stepLabels.getOrElse(step - 1) { "Complete" to "" }
Ux4gCompactStepper(
totalSteps = stepLabels.size,
currentStep = step,
stepLabel = currentInfo.first,
description = currentInfo.second,
layout = Ux4gCompactStepperLayout.Linear,
onNext = { if (step < stepLabels.size) step++ },
onPrevious = { if (step > 1) step-- },
modifier = Modifier.padding(16.dp)
)
}Parameters
Ux4gStepper Props
| Prop | Type | Description | Default |
|---|---|---|---|
totalSteps * | Int | Total number of steps in the sequence. | — |
currentStep * | Int | Active step index (1-indexed). | — |
modifier | Modifier | Compose modifier applied to the outer layout. | Modifier |
orientation | StepperOrientation | Stepper orientation (Horizontal or Vertical). | StepperOrientation.Horizontal |
lineStyle | StepperLineStyle | Visual connecting line style (Solid or Dashed). | StepperLineStyle.Solid |
linePlacement | StepperLinePlacement | Connecting line position (Center or Bottom). | StepperLinePlacement.Center |
steps | List<Ux4gStepItem> | List of step models providing titles, descriptions, and statuses. | emptyList() |
stepSize | Dp | Diameter of the circular step icon indicator. | 32.dp |
showLabels | Boolean | Whether step titles, descriptions, and statuses are displayed. | true |
edgeLabelAlignment | Boolean | In horizontal layout, aligns first step to start and last step to end. | false |
activeStepBackground | Boolean | In bottom-line layout, highlights active step column with light tint. | false |
stepSpacing | Dp | Spacing between steps in vertical orientation. | 24.dp |
alignIconWithDescription | Boolean | Offsets top step icon to align with multi-line descriptions in vertical mode. | false |
colors | Ux4gStepperColors | Color palette configuration for circles, lines, and text. | Ux4gStepperDefaults.colors() |
Ux4gStepItem Model Props
| Prop | Type | Description | Default |
|---|---|---|---|
title * | String | Main label title for the step. | — |
description | String? | Optional explanatory subtitle text. | null |
statusLabel | String? | Optional status text override (e.g., "Completed", "In progress"). | null |
isError | Boolean | Whether this step is rendered in an error state. | false |
titleStyle | TextStyle? | Custom typography override for the step title. | null |
descriptionStyle | TextStyle? | Custom typography override for the step description. | null |
statusStyle | TextStyle? | Custom typography override for the status label. | null |
Ux4gCompactStepper Props
| Prop | Type | Description | Default |
|---|---|---|---|
totalSteps * | Int | Total number of steps in the sequence. | — |
currentStep * | Int | Active step index (1-indexed). | — |
stepLabel * | String | Primary title label for the active step. | — |
modifier | Modifier | Compose modifier applied to the container. | Modifier |
description | String? | Optional description for the active step. | null |
onNext | () -> Unit | Callback invoked when the user taps Next. | {} |
onPrevious | () -> Unit | Callback invoked when the user taps Previous. | {} |
layout | Ux4gCompactStepperLayout | Layout arrangement (Linear, RightAligned, Centered, CenteredBetween, Split). | Ux4gCompactStepperLayout.Linear |
labelAlignment | Alignment.Horizontal | Text alignment for labels in linear layout. | Alignment.Start |
activeColor | Color? | Custom color override for the active capsule pill. | null |
inactiveColor | Color? | Custom color override for inactive capsule pills. | null |
colors | Ux4gCompactStepperColors | Color palette configuration. | Ux4gCompactStepperDefaults.colors() |
StepperOrientation & StepperLinePlacement Reference
| Orientation / Placement | Description |
|---|---|
StepperOrientation.Horizontal | Standard horizontal layout across desktop headers and top wizard bars. |
StepperOrientation.Vertical | Vertical timeline column layout with connecting lines running downward. |
StepperLinePlacement.Center | Connecting line passes through the center of the step circle icons. |
StepperLinePlacement.Bottom | Connecting line runs horizontally along the bottom baseline beneath labels. |
Ux4gCompactStepperLayout Reference
| Layout Variant | Description |
|---|---|
Linear | Navigation buttons flank the top capsule row, with title/desc on bottom-left. |
RightAligned | Top row holds capsules and buttons; bottom-left holds step count, bottom-right holds title/desc. |
Centered | Top row holds capsules; middle row holds buttons and step count; bottom holds centered title/desc. |
CenteredBetween | Top row holds capsules; middle holds step count; bottom row flanks title with left/right buttons. |
Split | Top row holds capsules; bottom-left holds title/desc, bottom-right holds step count & buttons. |