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

masa-ui-elements

v0.1.1

Published

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.1.3.

Readme

UI Elements

This project was generated with Angular CLI version 1.1.3.

Development server

Run yarn start for a dev server. Navigate to http://localhost:4200/.

Build

Run yarn build to build the project. The build artifacts will be stored in the dist/ directory.

Example

A working example can be found here.

Input

Usage

<masa-input label="Label"></masa-input>

The model can be bound like any other input with either [(ngModel)] and (ngModelChange) or using FormGroup.

For errors the element <sama-error> can be used.

<masa-input label="Label">
	<sama-error *ngIf="control.invalid">
		Error message
	</sama-error>
</masa-input>

Inputs

| Input | Description | Example | | ---------| ------------------------------------------------------------------------------------------------------------ | --------------------- | | label | A label (string) to show while nothing is selected and as label once something is | label="Label" | | disabled | A flag to disable the input | [disabled]="true" | | required | A flag to mark the input as required | [required]="true" |

Dropdown

Usage

The data must come in form of an array, that holds items with an id field (note, name is not important).

const data = [{
	id: 1,
	name: 'A'
}, {
	id: 2,
	name: 'B'
}, {
	id: 3,
	name: 'C'
}]

The data array may also consist of groups, that have a title property (will be rendered) and an items array, that must come in the form of the above.

const groupedData = [{
	title: 'Group 1',
	items: [{
		id: 1,
		name: 'A'
	}, {
		id: 2,
		name: 'B'
	}]
}, {
	title: 'Group 2',
	items: [{
		id: 3,
		name: 'C'
	}]
}];

To use the component, a template to render the items must be defined with the angular-id #option.

<masa-dropdown [data]="someData" label="Label">
	<ng-template #option let-item="item">
		{{ item.name }}
	</ng-template>
</masa-dropdown>

A second template for rendering the seleciton may also be defined with the angular-id #display. If none is set, the item template will be used.

<masa-dropdown [data]="someData" label="Label">
	<ng-template #display let-selection="item">
		<div>
			{{ selection.name }}
		</div>
		<div>
			{{ selection.description}}
		</div>
	</ng-template>

	<ng-template #option let-item="item">
		{{ selection.name }}
	</ng-template>
</masa-dropdown>

The model can be bound like any other input with either [(ngModel)] and (ngModelChange) or using FormGroup.

For errors the element <sama-error> can be used.

<masa-dropdown [data]="someData" label="Label">
	<ng-template #option let-item="item">
		{{ item.name }}
	</ng-template>
	
	<sama-error *ngIf="control.invalid">
		Error message
	</sama-error>
</masa-dropdown>

Inputs

| Input | Description | Example | | ---------| ------------------------------------------------------------------------------------------------------------ | --------------------- | | data | The data | [data]="someData | | label | A label (string) to show while nothing is selected and as label once something is | label="Label" | | search | An array of fields that may be searched. If none is provided, the search will not be available | [search]="['name']" | | noSearch | A numeric limit from which the search will be shown. Only shows search if there are more than 10 items | [noSearch]="10" | | disabled | A flag to disable the input | [disabled]="true" | | required | A flag to mark the input as required | [required]="true" |

Auto complete

Usage

The data is coming from an async datasource in form of an Observable. For this, bind a function, returning an Observable to the source attribute. The resolved data must be an array.

There are no restrictions on the items within the result set. A function to turn the item into a string must be provided. This will get executed, when an element of the auto-complete list is selected.

To use the component, a template to render the items must be defined with the angular-id #option.

<masa-auto-complete
	[source]="asyncDataSource"
	[itemRenderer]="itemToString"
>
	<ng-template #option let-user="item">
		{{ user.firstName }} {{ user.lastName }}
	</ng-template>
</masa-auto-complete>

A second template to render a message in case of a data-overflow may be provided. This will be shown, if the result set is bigger than the specified maximum amount of items to be displayed.

<masa-auto-complete
	[source]="asyncDataSource"
	[itemRenderer]="itemToString"
	[maxItems]="3"
>
	<ng-template #option let-user="item">
		{{ user.firstName }} {{ user.lastName }}
	</ng-template>

	<ng-template #overflow let-number="number">
		<div class="overflow-warning">
			There are {{ number }} items, only the first 3 are shown
		</div>
	</ng-template>
</masa-auto-complete>

The model can be bound like any other input with either [(ngModel)] and (ngModelChange) or using FormGroup.

Important note: The returned value is the item object, not the string from the input field.

Input

| Input | Description | Example | | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | | source | A function returning an Observable data source: (text: string) => Observable<any[]> | [data]="asyncDataSource | | itemRenderer | A function turning the selected item into a string: (item: any) => string. If none is provided, the JS .toString() will be used. | [itemRenderer]="itemToString" | | minSearchLength | The minimum length of the typed text before an API request is started | [minSearchLength]="3" | | maxItems | The maximum number of items displayed in the list. If the result set exceeds this number, a warning will be shown, if a corresponding template is provided. | [maxItems]="10" | | loadingText | The text to be shown while the API request is pending | loadingText="Loading" | | noItemsText | The text to be shown, when the API request did not return any results | noItemsText="No items found | | disabled | A flag to disable the input | [disabled]="true" | | required | A flag to mark the input as required | [required]="true" |