Skip to content

shaunlee/alpinejs-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alpinejs-router

Easy to use and flexible router for Alpine.js

Getting Started

<a x-link href="/hello/world">Hello World</a>

<a x-link href="/somewhere">Load template</a>

<template x-route="/hello/:name">
  <div>Say hello to <span x-text="$store.router.params.name"></span></div>
</template>

<template x-route="/somewhere" template="/somewhere.html"></template>

somewhere.html

<div x-data="{ open: false }">
  <button @click="open = ! open">Toggle Content</button>

  <div x-show="open">Content...</div>
</div>

About

Easy to use and flexible router for Alpine.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published