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

aln-tags-input

v0.1.1

Published

A stencil component for tags input

Readme

Stencil Tags Input Component

This is tags input web component built using Stencil. It works in any major framework or with no framework at all.

Install this component

Ionic4 + angular

  1. Run npm install aln-tags-input --save
  2. Include the CUSTOM_ELEMENTS_SCHEMA in the modules that use the components
import { BrowserModule } from '@angular/platform-browser';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, FormsModule],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
  1. Call defineCustomElements(window) from main.ts (or some other appropriate place)
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import { defineCustomElements } from 'aln-tags-input/dist/loader';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.log(err));
defineCustomElements(window);

Reference Stencil doc for more framework integration: https://stenciljs.com/docs/overview

Script tag

  1. Put a script tag similar to this <script src='https://unpkg.com/[email protected]/dist/aln-controls.js'></script> in the head of your index.html
  2. Then you can use the element anywhere in your template, JSX, html etc

Using this component

Ionic4 + angular

Access it using ViewChild or ViewChildren

import {Component, ElementRef, ViewChild} from '@angular/core';
import 'aln-tags-input'

@Component({
  selector: 'app-test',
  template: '<div><aln-tags-input #tagsInput ></aln-tags-input><button (click)="clearTags()">Remove all tags</button></div>'
})
export class TestPage implements OnInit {

  @ViewChild('tagsInput') tagsInputComponent: ElementRef<HTMLAlnTagsInputElement>;
  
  async clearTags() {
    // Access component property
    console.log(this.tagsInputComponent.nativeElement.tags)
    // Call component method
    await this.tagsInputComponent.nativeElement.clear();
  }
}

Pure html + javascript

Add the tag <aln-tags-input> to your html page. We style the component using css4 variables.

...
<style>
  .default-style {
    --tag-bg: green;
    --tag-color: white;
    --tag-border-radius: 5px;
    --tag-input-width: 100px;
    --tag-input-display: inline;
    --tag-padding: 5px 8px;
    --tag-btn-icon-size: 16px;
    --tag-btn-icon-remove-color: white;
    --tag-btn-icon-add-color: black;
  }

  .display-block {
    --tag-input-width: calc(100% - 30px);;
    --tag-input-display: block;
  }
</style>
...
<h4>default</h4>
<aln-tags-input tags-below="false" class="default-style" ></aln-tags-input>
<h4>readonly</h4>
<aln-tags-input id="readonly" tags-below="false" class="default-style" readonly="true"></aln-tags-input>
<h4>block input</h4>
<aln-tags-input name="preset" tags-below="true" class="display-block" hide-input="false"></aln-tags-input>
<h4>show tags only</h4>
<aln-tags-input name="preset" tags-below="true" class="display-block" hide-input="true"></aln-tags-input>
<h4>show tags only + readonly</h4>
<aln-tags-input name="preset" tags-below="true" class="display-block" hide-input="true" readonly="true"></aln-tags-input>

<script>
  const tagReadonly = document.getElementById('readonly')
  tagReadonly.tags = ['this', 'is', 'readonly']

  const tagsInputElems = document.getElementsByName('preset')
  tagsInputElems.forEach(e => {
    e.tags = ['this', 'is', 'a', 'test']
  })
</script>

Property

  • tags: array of tags
  • tags-below: show tags below input
  • readonly: set to true for readonly input
  • hide-input: hide input field

Method

  • clear(): remove all tags