0.1.1 • Published 3 years ago

history-router-elements v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

history-router-elements

minimal declarative custom element pushstate routing for browser apps

install

npm i -S history-router-elements
yarn add history-router-elements
<script type="module" src="https://unpkg.com/history-router-elements/history-browser-elements.mjs"></script>
<script type="nomodule" src="https://unpkg.com/history-router-elements/history-browser-elements.umd.js"></script>

usage

<history-router>
    <nav>
        <ul>
            <li><a is="history-link" href="/">Home</a></li>
            <li><a is="history-link" href="/one">One</a></li>
            <li><a is="history-link" href="/two">Two</a></li>
        </ul>
    </nav>
    <history-route path="/">
        <template>
            <h1>Home</h1>
        </template>
    </history-route>
    <history-route path="/one">
        <template>
            <h1>One</h1>
        </template>
    </history-route>
    <history-route path="/two">
        <template>
            <h1>Two</h1>
        </template>
    </history-route>
</history-router>
0.1.1

3 years ago

0.1.0

3 years ago