svelte-page-tab

Svelte Page Tab

šŸŽ¹ Tab menu component that uses page as a state

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

Demo

Installation

npm i svelte-page-tab

Usage

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

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

<style>
  ul {
    /* list styles */
  }
  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>

License

MIT

Top categories

Loading Svelte Themes