Build a tabbed interface.
Component
@php
use Livewire\Attributes\Url;
new class extends Livewire\Component {
#[Url]
public string $activeTab = 'overview';
}
@endphp
<div>
<nav>
@foreach(['overview', 'details', 'reviews'] as $tab)
<button
wire:click="$set('activeTab', '{{ $tab }}')"
class="{{ $activeTab === $tab ? 'active' : '' }}">
{{ ucfirst($tab) }}
</button>
@endforeach
</nav>
@if($activeTab === 'overview')
<div>Overview content</div>
@endif
</div>