0

I am just wondering whether it's possible to navigate through navigation without any page refresh using Laravel Livewire and AlpineJS? I also want to keep the state of the clicked link of the navbar, so I can change it's color. Thanks

codingIsLove
  • 101
  • 1
  • 8

1 Answers1

0

There is indeed. Livewire v3 has just been released and it includes that ability:

Livewire offers a single page application experience via a simple attribute you can add to links in your application: wire:navigate.

For example:

<nav>
    <a href="/" wire:navigate>Dashboard</a>
    <a href="/posts" wire:navigate>Posts</a>
    <a href="/users" wire:navigate>Users</a>
</nav>

For more, check out:

https://livewire.laravel.com/docs/navigate

coder_uk
  • 657
  • 1
  • 8
  • 20