This component provides routing functionality for web applications using the remote-call mixin for
inter-component communication. It consists of two parts:
ars-page for content routing and
ars-page-controller for navigation controls.
đ Current Status
Current Page:Loading...
Available Pages:Loading...
Total Pages:Loading...
đ Home Page
Welcome to the ARS Page Router demo! This is the home page content.
The ARS Page Router provides a simple and efficient way to handle page navigation in web applications
using web components and the remote-call mixin for inter-component communication.
The ARS Page Router is designed to be simple yet powerful, providing all the routing functionality
you need for modern web applications without the complexity of large frameworks.
đ Implementation Guide
How to Use ARS Page Router:
Usage: Wrap your custom navigation HTML (e.g., <nav> with
<button data-page="home">) inside <ars-page-controller>. The
controller will listen for clicks on any child with a data-page attribute and trigger
navigation accordingly.
Convention: Use data-page="pageId" on navigation elements to indicate the
target page. The controller will automatically add the active class to the button for the
current page.
1. Import the components: import './ars-page.js' and
import './ars-page-controller.js'
2. Create your page router: <ars-page id="my-router" default-page="home">
3. Add page content as direct children with IDs
4. Create a controller:
<ars-page-controller target-page="my-router">...</ars-page-controller>
5. The components will automatically communicate via the remote-call mixin