history-router-elements

0.1.1 • Public • Published

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>

Readme

Keywords

none

Package Sidebar

Install

npm i history-router-elements

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

49.1 kB

Total Files

5

Last publish

Collaborators

  • nnnnathann