npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

zensele-tabs

v0.0.17

Published

Svelte tabs component

Downloads

39

Readme

ko-fi

zenSele Tabs

Svelte tab bar component.

Demo

Check out this repl

Install

npm install --save zensele-tabs

Usage

  • Arrays

    <script>
        import { Tabs } from "zensele-tabs";
    
        let tabs = ["One", "Two", "Three"];
    </script>
    
    <div>
        <Tabs {tabs}/>
    </div>
  • Object Arrays - when passing object arrays then we need to specify which property of the object to be used as label

    <script>
        import { Tabs } from "zensele-tabs";
    
        let tabs = [
            { name: "One 1", blah: 123 },
            { name: "Two 2", blah: 123 },
            { name: "Three 3", blah: 123 },
        ];
    </script>
    
    <div>
        <Tabs {tabs} property={'name'}/>
    </div>

Properties

  • tabs - array (or objects array) with the values that should be displayed as labels
  • color - what color to be the active tab text and bottom border
  • property - when object array is passed, as tabs, specify which object property to be used as label
  • showNavigation - (default true) When its set to false the navigation arrows will be shown only when there is no enough space for all the tabs to be shown at the same time
  • enableDelete - (default true) show/hide delete icon
  • enableAdd - (default true) show/hide add icon
  • maxWidth - (default null, optional) control the max width, in px, of the tabs. Example: maxWidh="{300}"

Events

  • tabIndexChange - when tab index is changed then this event will be dispatched. The data in the event will return the index and the data of the selected tab.

    Having the code below:

    <script>
        import { Tabs } from "zensele-tabs";
    
        let tabs = [
            { name: "One 1", blah: 123 },
            { name: "Two 2", blah: 123 },
            { name: "Three 3", blah: 123 },
        ];
    </script>
    
    <div>
        <Tabs
            {tabs}
            property={'name'}
            on:tabIndexChange={(event) => console.log(event.detail)/>
    </div>

    And if we select the second element ({ name: "Two 2", blah: 123 }) will output the following data in the console:

    {
        index: 1,
        data: {
            name: "Two 2"
            blah: 123
        }
    }
    • addTab - when add tab button is pressed. Apart from the event iteself no other details are passed
    • removeTab - each tab have a remove button when the tab is active). The event returns the index of the tab that triggered it

Setting active tab

The component expose selectedTabIndex function which is used to set the active tab. Just pass the required tab index that need to be "activated"

<script>
    import { Tabs } from "zensele-tabs";

    let tabBar;
    function changedType(type) {
        tabBar.selectedTabIndex(0)
    }

    let tabs = [
        { name: "One 1", blah: 123 },
        { name: "Two 2", blah: 123 },
        { name: "Three 3", blah: 123 },
    ];

</script>

<div>
    <Tabs {tabs} bind:this="{tabBar}"/>
</div>