Progress indicators:
Simple Progress Bar
public int $progress = 0;
public function processItems()
{
$items = Item::all();
$total = $items->count();
foreach ($items as $index => $item) {
$item->process();
$this->progress = (($index + 1) / $total) * 100;
}
}View
<div class="progress-bar" style="width: {{ $progress }}%"></div>
<span>{{ $progress }}%</span>
<button wire:click="processItems">
<span wire:loading.remove>Start</span>
<span wire:loading>Processing...</span>
</button>With Steps
public int $currentStep = 1;
public int $totalSteps = 5;