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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@author.io/element-datalist

v1.1.1

Published

author-datalist custom element (web component).

Downloads

33

Readme

AuthorDatalistElement Build Status

author-datalist is a fully-stylable datalist component. It is designed to match the functionality of browser default datalists while providing flexibility for customization if desired.

author-datalist is broken down into several components:

  • author-selected-options
  • author-options
  • author-option

This allows each part of the component to be styled directly. Each of these components can also be used standalone in other applications as well.

Source Size Deliverable Size npm

We're using BrowserStack to make sure these components work on the browsers developers care about.

Usage

There are 4 versions of this element:

  1. author-datalist.min.js (ES6 Minified for Production)
  2. author-datalist.js (ES6 Unminified for Debugging)
  3. author-datalist.es5.min.js (ES5 Minified for Production)
  4. author-datalist.es5.js (ES5 Unminified for Debugging)

You only need to choose one of these files. If you need to support Internet Explorer, older versions of Chrome/Firefox/Safari, then you likely need the ES5 version. Each version has it's own source map, so it's always possible to trace activity back to a specific code block in the source.

The simplest way to use author-datalist is in combination with author-control. This combination makes it simple to create totally stylable datalists. Placing a datalist tag inside an author-control will automatically generate a fully-functional author-datalist element and pair it with a label if provided.

Via Global CDN

<html>
  <head>
    <script src="https://cdn.author.io/author-elements/base/1.0.0/author-base.min.js"></script>
    <script src="https://cdn.author.io/author-elements/datalist/x.x.x/author-datalist.min.js"></script>
  </head>
</html>

Via npm

  1. If the base class is not yet installed, install it:

npm install @author.io/element-base -S

  1. Next, install the datalist module locally:

npm install @author.io/element-datalist -S

  1. If using with author-control, install it:

npm install @author.io/element-control -S

  1. Then include the components in your HTML:
<html>
  <head>
    <script src="./node_modules/@author.io/element-base/dist/author-base.min.js"></script>
    <script src="./node_modules/@author.io/element-base/dist/author-control.min.js"></script>
    <script src="./node_modules/@author.io/element-datalist/dist/author-datalist.min.js"></script>
  </head>

  <body>
    <author-control>
      <label>Basic Datalist</label>
      <input type="text" placeholder="Enter your search query">
      <datalist [placeholder="datalist an Option"]>
        <option value="Option 1">Option 1</option>
        <option value="Option 2">Option 2</option>
        <option value="Option 3">Option 3</option>
      </datalist>
    </author-control>
  </body>
</html>

If using without author-control, lay out author-datalist manually using the following markup:

<author-datalist>
  <!-- <slot name="afterbegin"></slot> -->

  <!-- <slot name="beforeinput"></slot> -->
  <input slot="input" type="text" placeholder="Enter your search query">
  <!-- <slot name="afterinput"></slot> -->

  <!-- <slot name="beforeselectedoptions"></slot> -->
  <author-selected-options slot="selectedoptions"></author-selected-options>
  <!-- <slot name="beforeselectedoptions"></slot> -->

  <!-- <slot name="beforeoptions"></slot> -->
  <author-options slot="options">
    <author-option value="Option 1">Option 1</author-option>
    <author-option value="Option 2">Option 2</author-option>
    <author-option value="Option 3">Option 3</author-option>
  </author-options>
  <!-- <slot name="afteroptions"></slot> -->

  <!-- <slot name="beforeend"></slot> -->
</author-datalist>

Additional elements can be added to the various slots within the markup if desired.

Customization and Styling

author-datalist is optimized for use with NGN Chassis, a PostCSS-powered CSS Framework and Preprocessor. If using author-datalist separately, it and all its child elements can be styled directly with CSS. For a quick start, download the default theme.

The child elements of author-datalist can also be used independently to create customized UI components. See also author-datalist.