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-select

v0.0.5

Published

Webcomponent dile-select following open-wc recommendations

Readme

<dile-select> & <dile-select-multiple>

Web components to implement a select dropdown menu. <dile-select> implements a interface to select one single value. <dile-select-multiple> implements a interface to select multiple values in a list.

Installation

npm i dile-select

<dile-select> Usage

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

<dile-select label="Favorite fruit:" value="pear" class="custom" placeholder="Select a fruit" @dile-select-changed="${this.selectChanged}">
  <dile-select-item value="kiwi">Kiwi fruit</dile-select-item>
  <dile-select-item value="pear">Pear</dile-select-item>
  <dile-select-item value="apple">Apple</dile-select-item>
  <dile-select-item value="orange">Orange</dile-select-item>
  <dile-select-item value="passion_fruit">True passion fruit</dile-select-item>
</dile-select>

<dile-select-multiple> Usage

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

<dile-select-multiple placeholder="Select at least 1" label="Favorite cars">
  <dile-select-multiple-item value="general-motors">General Motors</dile-select-multiple-item>
  <dile-select-multiple-item value="volkswagen">Volkswagen</dile-select-multiple-item>
  <dile-select-multiple-item value="toyota">Toyota</dile-select-multiple-item>
  <dile-select-multiple-item value="fiat">Fiat</dile-select-multiple-item>
  <dile-select-multiple-item value="renault">Renault</dile-select-multiple-item>
</dile-select-multiple>

Properties

Properties specific for <dile-select>

  • value (String): Stores the value of the selected item. Also Useful for the component initialization.
  • uninitialized: When the component initializes, it takes the first option value as default. If uninitialized property is set to true, then the element do not initialize with any value.

Properties specific for <dile-select-multiple>

  • value (Array): Stores the values of the selected items (array of strings). Also Useful for the component initialization.
  • labelNumItem: For configure the selected text message. Something like "fruits selected" will show a message "3 fruits selected" when the user has selected 3 diferent options.
  • uninitialized: Even the component has this property, it is unuseful in multiple select components, because there is not a default initialization, only the one you can apply with the value array property.

Common properties for both components

  • name: Name for the component. So, you can know which element element is related when a changed event is received.
  • opened: This defines the component open / close state. the default placeholder is 'Select'.
  • selectedText: Stores the innerText of the current selected option.
  • label: A label for the element.
  • placeholder: Placeholder. Appears when there isn't a selected element.
  • errored: Display select in a error state

Methods

  • selectItem(value): this method is useful to select a item programaticaly. You should pass the string option value.
  • open(): Opens the dropdown menu.
  • close(): Closes the dropdown menu.

events

  • dile-select-changed: dispatched when the select element changes it's current value. This custom event gives some useful data in the detail property.

Custom properties

CSS custom properties defined on <dile-select>:

Custom property | Description | Default ----------------|-------------|--------- --dile-select-width | width of the select element | auto --dile-select-text-color | Text color of the selected item | #303030 --dile-select-background-color | Background color of the selected item | #ddd --dile-select-border-width| Border width of the interface. Only supports width in pixel units!! | 0 --dile-select-border-color | Border color of the interface | #888 --dile-select-border-radius | Border radius of the interface | 10px --dile-select-hover-background-color | Background color when hover in a item | #eee --dile-select-label-font-size| Label font size | 1em --dile-select-label-color | Label text color | #59e --dile-select-label-font-weight | Label font weight | normal --dile-select-padding-x | Horizontal padding (left & right) of the items | 10px --dile-select-padding-y | Vertical padding (top & bottom) of the items | 10px --dile-select-errored-background-color | Error background color | #f66 --dile-select-errored-text-color | Error items text color | #fff

The component <dile-select-multiple> has the same CSS custom properties than <dile-select>, and also:

Custom property | Description | Default ----------------|-------------|--------- --dile-select-multiple-unchecked-color | Color for the checkbox in unselected state | #aaa --dile-select-multiple-checked-color | Color for the checkbox in selected state | #26e