Is there any router for alpinejs?
There is no router, you can read the URL and replace/add to it using DOM APIs directly (window.location, URL object, and history API)
If you want a simple router, check this out: https://dev.to/aminnairi/a-router-without-a-web-server-in-vanilla-javascript-3bmg
If you want a lib to do so, try https://github.com/egoist/franxx or https://github.com/krasimir/navigo
Alpine isn't really meant for building entire single page applications. It's possible, but not what it's meant for.
Thanks for weighing in everyone.
Just to give an example: if you really, really want to do routing (or even some sort of show and hide thing based on the URL) you can do
<div x-data="{page: location.hash}" @hashchange.window="page = location.hash">
<span x-show="page === ''">Index Page</span>
<span x-show="page === '#contact'">Contact Page</span>
</div>
...
<a href="#contact">Contact Us!</a>
No external framework required!
Most helpful comment
Just to give an example: if you really, really want to do routing (or even some sort of show and hide thing based on the URL) you can do
No external framework required!