@useskit/router
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Version Version forks stars License: MIT

Kit Router is a small and smart front-end router for javascript

🌏 Website

please visit! https://www.useskit.com

🛠️ Install

  • CDN Link

unpkg visit url : https://unpkg.com/@useskit/router

<script src="https://unpkg.com/@useskit/router"></script>
  • NPM install
npm i @useskit/router

✍️ Usage

  • HTML code fragment in index.html
  <header>
    <nav>
      <router-link to="/">First Page</router-link>
      <router-link to="second">Second Page</router-link>
      <router-link to="third">Third Page</router-link>
    </nav>
  </header>
  <main>
    <section id="first" style="display: none;">
      <p>First</p>
      <router-link to="second">Go To Second</router-link>
      <router-link to="third">Go To Third</router-link>
    </section>

    <section id="second" style="display: none;">
      <p>Second</p>
      <router-link to="/">Go To First</router-link>
      <router-link to="third">Go To Third</router-link>
    </section>

    <section id="third" style="display: none;">
      <p>Third</p>
      <router-link to="/">Go To First</router-link>
      <router-link to="second">Go To Second</router-link>
    </section>
  </main>
  • JS code fragment in index.html
 <script src="https://unpkg.com/@useskit/router"></script>
 <script>
   const _router = new KitRouter({
     root: 'main',
     rootPath: '/router',
     mode: 'hash',
     routes: [
       { path: '/', name: 'first', component: 'first', title: 'The first page' },
       { path: '/second', name: 'second', component: 'second' },
       { path: '/third', name: 'third', component: 'third' },
     ],
   })
 </script>

🧪 Functions

  • It is not dependent on any framework
  • Allowing it to be easily integrated with any of them

🧑 Author

  • 🧑 Aipeli

🤝 Contributing

Contributions, issues and feature requests are welcome! issues page.

⭐️ Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 aipeli && UsesKit. This project is MIT licensed.


This README was generated with ❤️ by fast-readme

Package Sidebar

Install

npm i @useskit/router

Weekly Downloads

3

Version

0.1.3

License

MIT

Unpacked Size

23.5 kB

Total Files

7

Last publish

Collaborators

  • uses-kit
  • aipeli