UX4G Logo
Components

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) and Vertical orientations 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.

Ux4gStepper (Horizontal)Jetpack Compose
UX4G Horizontal Stepper Preview

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.

Ux4gStepper (Horizontal with Error State)Jetpack Compose
UX4G Horizontal Stepper with Error State Preview

3. Horizontal Stepper (Bottom Line)

Horizontal stepper variant where the continuous progress indicator line runs beneath the step labels and descriptions.

Ux4gStepper (Bottom Line)Jetpack Compose
UX4G Horizontal Stepper with Bottom Line Preview

4. Vertical Stepper

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

Ux4gStepper (Vertical)Jetpack Compose
UX4G Vertical Stepper Preview

5. Compact Stepper (Linear)

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

Ux4gCompactStepper (Linear)Jetpack Compose
UX4G Compact Stepper Linear Preview

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.

Ux4gCompactStepper (Right Aligned)Jetpack Compose
UX4G Compact Stepper Right Aligned Preview

7. Compact Stepper (Centered Split)

Centered compact stepper with top progress capsules, middle step count, and centered title/description flanked by circular navigation buttons.

Ux4gCompactStepper (Centered)Jetpack Compose
UX4G Compact Stepper Centered Preview

Kotlin Usage

1. Multi-Step Citizen Application Wizard

CitizenFormWizard.kt
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

MobileOnboardingStepper.kt
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

PropTypeDescriptionDefault
totalSteps *IntTotal number of steps in the sequence.—
currentStep *IntActive step index (1-indexed).—
modifierModifierCompose modifier applied to the outer layout.Modifier
orientationStepperOrientationStepper orientation (Horizontal or Vertical).StepperOrientation.Horizontal
lineStyleStepperLineStyleVisual connecting line style (Solid or Dashed).StepperLineStyle.Solid
linePlacementStepperLinePlacementConnecting line position (Center or Bottom).StepperLinePlacement.Center
stepsList<Ux4gStepItem>List of step models providing titles, descriptions, and statuses.emptyList()
stepSizeDpDiameter of the circular step icon indicator.32.dp
showLabelsBooleanWhether step titles, descriptions, and statuses are displayed.true
edgeLabelAlignmentBooleanIn horizontal layout, aligns first step to start and last step to end.false
activeStepBackgroundBooleanIn bottom-line layout, highlights active step column with light tint.false
stepSpacingDpSpacing between steps in vertical orientation.24.dp
alignIconWithDescriptionBooleanOffsets top step icon to align with multi-line descriptions in vertical mode.false
colorsUx4gStepperColorsColor palette configuration for circles, lines, and text.Ux4gStepperDefaults.colors()

Ux4gStepItem Model Props

PropTypeDescriptionDefault
title *StringMain label title for the step.—
descriptionString?Optional explanatory subtitle text.null
statusLabelString?Optional status text override (e.g., "Completed", "In progress").null
isErrorBooleanWhether this step is rendered in an error state.false
titleStyleTextStyle?Custom typography override for the step title.null
descriptionStyleTextStyle?Custom typography override for the step description.null
statusStyleTextStyle?Custom typography override for the status label.null

Ux4gCompactStepper Props

PropTypeDescriptionDefault
totalSteps *IntTotal number of steps in the sequence.—
currentStep *IntActive step index (1-indexed).—
stepLabel *StringPrimary title label for the active step.—
modifierModifierCompose modifier applied to the container.Modifier
descriptionString?Optional description for the active step.null
onNext() -> UnitCallback invoked when the user taps Next.{}
onPrevious() -> UnitCallback invoked when the user taps Previous.{}
layoutUx4gCompactStepperLayoutLayout arrangement (Linear, RightAligned, Centered, CenteredBetween, Split).Ux4gCompactStepperLayout.Linear
labelAlignmentAlignment.HorizontalText alignment for labels in linear layout.Alignment.Start
activeColorColor?Custom color override for the active capsule pill.null
inactiveColorColor?Custom color override for inactive capsule pills.null
colorsUx4gCompactStepperColorsColor palette configuration.Ux4gCompactStepperDefaults.colors()

StepperOrientation & StepperLinePlacement Reference

Orientation / PlacementDescription
StepperOrientation.HorizontalStandard horizontal layout across desktop headers and top wizard bars.
StepperOrientation.VerticalVertical timeline column layout with connecting lines running downward.
StepperLinePlacement.CenterConnecting line passes through the center of the step circle icons.
StepperLinePlacement.BottomConnecting line runs horizontally along the bottom baseline beneath labels.

Ux4gCompactStepperLayout Reference

Layout VariantDescription
LinearNavigation buttons flank the top capsule row, with title/desc on bottom-left.
RightAlignedTop row holds capsules and buttons; bottom-left holds step count, bottom-right holds title/desc.
CenteredTop row holds capsules; middle row holds buttons and step count; bottom holds centered title/desc.
CenteredBetweenTop row holds capsules; middle holds step count; bottom row flanks title with left/right buttons.
SplitTop row holds capsules; bottom-left holds title/desc, bottom-right holds step count & buttons.

On this page