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

dile-tabs

v2.1.0

Published

Webcomponent dile-tabs following open-wc recommendations

Readme

<dile-tabs>

Web Component to implement a tabs interface. Based on LitElement

Go to DEMOS page

Installation

npm i dile-tabs

Usage

<dile-tabs> is a component you may use to select one of several posible values. It shows to the user creating a tabs interface.

To use the component you need include (or import) the component script, and then use a markup based on two tags. First of them is <dile-tabs>, which is the entire set of tabs. The second component is <dile-tab> (in singular), which is one of the tabs of the interface.

<script type="module">
  import 'dile-tabs/dile-tabs.js';
</script>

<dile-tabs selected="2">
    <dile-tab>One</dile-tab>
    <dile-tab>Two</dile-tab>
    <dile-tab>Three</dile-tab>
    <dile-tab>Four</dile-tab>
  </dile-tabs>

Properties

The component has the properties bellow:

selected:

This property sets the currently selected tab of the interface. By default the selected value need to be an integer, specifying th index of the selected tab (starting at 0 for the first tab, 1 for the second...).

attrForSelected:

This property tells the <dile-tabs> component which attribute need to match the selected property to set the active tab. By default atrrForSelected is undefined. In that case the selected property should be an integer and match to the index of the tab. If you set atrrForSelected with a value, then the selected property will be matched with the value of the attribute named in attrForSelected.

The next example show how to use the attrForSelected property

<dile-tabs selected="posts" attrForSelected="name">
  <dile-tab name="users">Users</dile-tab>
  <dile-tab name="posts">Posts</dile-tab>
  <dile-tab name="articles">Articles</dile-tab>
  <dile-tab name="faq">FAQ</dile-tab>
  <dile-tab name="contact">Contact</dile-tab>
</dile-tabs>

Events

dile-tabs-selected-changed:

When selected property changes by a user interaction inside the <dile-tabs> component, it dispatch the dile-tabs-selected-changed custom event. You will recive the new selected value in the detail event object property.

CSS custom properties

You can customize the tabs using the CSS custom properties bellow.

Custom property | Description | Default ----------------|-------------|--------- --dile-tab-text-color | The tab text color | #666 --dile-tab-background-color | The tab background color | Transparent --dile-tab-selected-text-color | The tab text color | #fff --dile-tab-selected-background-color | The tab background color | #039be5; --dile-label-padding | Content padding of the tab | 8px 12px 6px 12px --dile-tab-selected-line-height | Defines selected tab line height | 5px --dile-tab-selected-line-color | Defines selected tab line color | #0070c0 --dile-tab-border-radius | Tab top-left & top-right border radius | 4px --dile-tab-border | Unselected tab border | none --dile-tab-selected-border | Selected tab border | none --dile-tab-font-weight | Tab font weight | normal --dile-tab-text-transform | Tab text transform | uppercase