svelte-page-tab

npm-version npm-license npm-download-month npm-min-size ci.yml website

🎹 Tab menu component that uses page as a state

â–· Installation

Current location : https://svelte-page-tab.jill64.dev/

<script>
  import { TabItems } from 'svelte-page-tab'
</script>

<ul>
  <TabItems
    routes={new Map([
      ['/', 'Top'],
      ['/page1', 'Page 1'],
      ['/page2', 'Page 2'],
      ['/page3', 'Page 3']
    ])}
  />
</ul>

<style>
  ul :global(li) {
    /* list item styles */
  }
  ul :global(a) {
    /* list item link styles */
  }
  ul :global(a[data-current-location]) {
    /* list item link (current location) styles */
  }
</style>