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

smt-select

v1.0.0

Published

A high-performance, lightweight, and customizable **Angular Select Component** with built-in Virtual Scroll and Search capabilities.

Readme

smt-select 👆

A high-performance, lightweight, and customizable Angular Select Component with built-in Virtual Scroll and Search capabilities.

✨ Features

  • 🔍 Searchable: Quickly filter through thousands of options.
  • ⚡ Virtual Scroll: Built-in support for high-performance rendering of large datasets.
  • ✅ Multi-Select: Support for multiple selection out of the box.
  • ☑️ Select All: Optional "Select All" toggle for multi-select mode.
  • ⌨️ Keyboard Navigation: Full keyboard support (Arrow keys, Enter, Escape).
  • 🚫 Disabled Options: Mark options as non-selectable.
  • ❌ Clearable: Optional clear button to reset selection.
  • 🎨 Custom Styling: Fully customizable via SCSS tokens.
  • 📱 Responsive: Works seamlessly across mobile and desktop.
  • 🛡️ Type Safe: Developed with strict TypeScript.

📺 Demo

smt-select demo


🧩 Angular Compatibility

| Angular Version | Support | |-----------------|---------| | 21.x | ✅ Yes | | 20.x | ✅ Yes | | 19.x | ✅ Yes | | 18.x | ✅ Yes |

🚀 Installation

npm install smt-select

Note: Angular CDK is a peer dependency and will be automatically installed by npm 7+. Make sure it matches your Angular version.

If you're using npm 6 or need a specific CDK version:

# Install CDK first (version should match your Angular version)
npm install @angular/cdk@^21.0.0

# Then install smt-select
npm install smt-select

📦 Usage

1. Component Logic (app.component.ts)

import { SmtSelectComponent, SmtSelectOption, SmtSelectConfig } from 'smt-select';

@Component({
  standalone: true,
  imports: [SmtSelectComponent],
  selector: 'app-root',
  templateUrl: './app.component.html'
})
export class AppComponent {
  myOptions: SmtSelectOption[] = [
    { value: 1, label: 'Option 1' },
    { value: 2, label: 'Option 2', disabled: true }, // Disabled option
    { value: 3, label: 'Option 3' }
  ];

  selectConfig: SmtSelectConfig = {
    placeholder: 'Choose an item...',
    virtualScroll: true,
    isMultiSelect: false,
    clearable: true, // Enable clear button
    noResultsMessage: 'No items found' // Custom no results message
  };

  // Multi-select configuration with Select All
  multiSelectConfig: SmtSelectConfig = {
    placeholder: 'Choose multiple items...',
    virtualScroll: true,
    isMultiSelect: true,
    showSelectAll: true, // Enable Select All option
    clearable: true
  };

  selectedValue: any = null;

  onSelection(value: any) {
    console.log('Selected value:', value);
  }
}

2. Template (app.component.html)

<smt-select
  [options]="myOptions"
  [config]="selectConfig"
  [(selectedValue)]="selectedValue"
  (selectionChange)="onSelection($event)">
</smt-select>

🎨 Customization

You can customize the component's appearance by providing custom colors:

selectConfig: SmtSelectConfig = {
  placeholder: 'Choose an item...',
  virtualScroll: true,
  isMultiSelect: false,
  // Custom theme colors
  optionActiveBackgroundColor: '#ff6b6b',
  optionActiveTextColor: '#ffffff',
  hoverBackgroundColor: '#ffe0e0',
  optionTextColor: '#333333',
  optionBackgroundColor: 'transparent',
  inputTextColor: '#000000', // Placeholder automatically uses 60% opacity
  borderColor: '#cccccc',
  errorBorderColor: '#d9534f',
  borderRadius: 8 // Can be number (px) or string ('8px', '0.5rem')
};

⚙️ API Reference

Inputs

| Property | Type | Default | Description | |----------|------|---------|-------------| | options | SmtSelectOption[] | [] | Array of options to display. | | config | SmtSelectConfig | {} | Configuration object for the component. | | selectedValue | any \| any[] | null | The currently selected value(s). Supports two-way binding. | | errorMessage | string \| null | undefined | Error message to display below the component. | | isInvalid | boolean | false | Manually trigger error state if errorMessage is not provided. | | visibility | SmtVisibilityType | ENABLED | Controls accessibility (ENABLED, READONLY, HIDDEN). |

Outputs

| Event | Payload | Description | |-------|---------|-------------| | selectionChange | any \| any[] | Fired when the selected value changes. | | selectedValueChange | any \| any[] | Fired when the selected value changes (for two-way binding support). | | pocketOpen | boolean | Fired when the dropdown is opened or closed. |

Option Structure (SmtSelectOption)

| Property | Type | Required | Description | |----------|------|----------|-------------| | value | any | Yes | The value of the option. | | label | string | Yes | Display text for the option. | | disabled | boolean | No | Mark option as non-selectable (default: false). |

Configuration (SmtSelectConfig)

| Property | Type | Description | |----------|------|-------------| | fieldID | string \| number | Unique ID for the wrapper element. | | placeholder | string | Text to show when no value is selected. | | virtualScroll | boolean | Enable/Disable CDK Virtual Scroll for large datasets. | | isMultiSelect | boolean | Enable multiple item selection. | | clearable | boolean | Show clear button to reset selection (default: false). | | showSelectAll | boolean | Show "Select All" option in multi-select mode (default: false). Only visible when isMultiSelect is true. | | noResultsMessage | string | Custom message when no results found (default: 'No results found'). | | Theme Colors | | | | optionActiveBackgroundColor | string | Background color for selected options (default: #005f87). | | optionActiveTextColor | string | Text color for selected options (default: #fff). | | hoverBackgroundColor | string | Background color for hovered items (default: #f0faff). | | optionTextColor | string | Text color for normal options (default: #333). | | optionBackgroundColor | string | Background color for normal options (default: transparent). | | inputTextColor | string | Text color for search input, selected value, and placeholder (with 60% opacity) (default: #333). | | borderColor | string | Border color for the component and dropdown (default: #ccc). | | errorBorderColor | string | Border color when in error state (default: #d9534f). | | borderRadius | string \| number | Border radius for the component and dropdown. Number will be converted to px (default: 4px). |


⌨️ Keyboard Shortcuts

When the dropdown is open:

  • Arrow Down / Arrow Up: Navigate through options
  • Enter: Select highlighted option
  • Escape: Close dropdown
  • Type to search: Filter options in real-time

📋 Changelog

See CHANGELOG.md for detailed release notes and version history.


📄 License

MIT © Samet Acar