Skip to content
Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Navigation

stepper

Shows progress through a multi-step flow: completed, current, upcoming and failed steps, horizontal or vertical.

  1. Account (Completed) Your details
  2. Shipping (Completed) Where it goes
  3. Payment (Current) Card or transfer
  4. Confirm (Upcoming) Review and place
  1. Upload (Completed)
  2. Validate (Error)
  3. Import (Upcoming)
  1. Order placed (Completed)
  2. Packed (Completed)
  3. Shipped (Completed)
  4. Delivered (Completed)

Installation

php artisan ui:add stepper

Usage

<x-ui.stepper :steps="['Account', 'Billing', 'Confirm']" :current="2" />

{{-- With descriptions, links back to finished steps, vertical. --}}
<x-ui.stepper orientation="vertical" :current="$step" :steps="[
    ['title' => 'Account', 'description' => 'Your details', 'href' => route('signup', ['step' => 1])],
    ['title' => 'Billing', 'description' => 'Plan and card', 'href' => route('signup', ['step' => 2])],
    ['title' => 'Confirm', 'description' => 'Review and finish'],
]" />

{{-- A failed step, plus translated screen-reader labels. --}}
<x-ui.stepper :steps="['Upload', 'Validate', 'Import']" :current="2" :error="2"
    :labels="['complete' => 'مكتمل', 'current' => 'الحالي', 'upcoming' => 'قادم', 'error' => 'خطأ']" />

{{-- The controller owns the step. No JavaScript involved:

    public function show(Request $request)
    {
        $step = min(max((int) $request->query('step', 1), 1), 3);

        return view('signup', ['step' => $step]);
    }

    public function store(Request $request)
    {
        // validate the current step, then move on
        return redirect()->route('signup', ['step' => $request->integer('step') + 1]);
    }
--}}

Pure markup, no JavaScript: the server decides current (1-based; past the last step marks all complete). steps takes strings or ['title', 'description', 'href'] arrays; href only links completed steps. orientation is horizontal or vertical, error marks a failed step, and labels overrides the screen-reader status words (complete, current, upcoming, error).

Props

Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.

@props([
    // Strings, or ['title' => ..., 'description' => ..., 'href' => ...].
    'steps' => [],
    // 1-based index of the active step. Past the last step = all complete.
    'current' => 1,
    'orientation' => 'horizontal',
    // 1-based index of a step that failed, or null.
    'error' => null,
    'label' => 'Progress',
    'labels' => [],
])