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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ng-searchix

v0.1.36

Published

Search modal (command palette style) for Angular using CDK Overlay.

Readme

ng-searchix

A beautiful, customizable search component for Angular with keyboard navigation, icon support, and external link integration.

Features

  • 🎨 Beautiful default UI with modern, clean design
  • 🎨 Fully customizable with 60+ CSS custom properties
  • 🔧 Custom button template support
  • 🎯 Icon library integration (Lucide, Heroicons, Font Awesome, or custom)
  • 🔗 External link support with dedicated icon
  • ⌨️ Keyboard navigation (↑/↓ arrows, Enter, Esc)
  • ⏱️ Recent items with automatic localStorage sync ⭐ NEW
  • 🚀 Lightweight with minimal dependencies
  • Accessible with ARIA attributes
  • 📱 Responsive design

Quick Start

Installation

npm install ng-searchix

Import Module

import { NgModule } from '@angular/core';
import { SearchixModule } from 'ng-searchix';

@NgModule({
  imports: [SearchixModule]
})
export class AppModule {}

Import Styles

Add to your angular.json:

"styles": [
  "node_modules/ng-searchix/styles/searchix.css",
  "src/styles.css"
]

Basic Usage

import { Component } from '@angular/core';
import { SearchItem } from 'ng-searchix';

@Component({
  selector: 'app-root',
  template: `
    <ngx-searchix
      [items]="searchItems"
      [placeholder]="'Search...'"
      [hotkey]="'ctrl+k'"
      (itemSelected)="onItemSelected($event)"
    ></ngx-searchix>
  `
})
export class AppComponent {
  searchItems: SearchItem[] = [
    {
      id: '1',
      title: 'Getting Started',
      subtitle: 'Learn the basics',
      icon: 'book',
      href: 'https://example.com/docs'
    },
    {
      id: '2',
      title: 'API Reference',
      subtitle: 'Complete documentation',
      icon: 'code',
      href: 'https://example.com/api'
    }
  ];

  onItemSelected(item: SearchItem) {
    console.log('Selected:', item);
  }
}

Documentation

Development

Build the Library

npm install
npm run build

The built library output will be in dist/ng-searchix.

Run Tests

npm test

Key Features

Custom Button Template

<ngx-searchix
  [items]="items"
  [buttonTemplate]="customButton"
></ngx-searchix>

<ng-template #customButton let-context>
  <button (click)="context.open()">
    Custom Search Button
  </button>
</ng-template>

Icon Integration

<ngx-searchix
  [items]="items"
  [iconRenderer]="iconRenderer"
></ngx-searchix>

<ng-template #iconRenderer let-iconName>
  <lucide-icon [name]="iconName"></lucide-icon>
</ng-template>

CSS Customization

:root {
  --searchix-bg: #ffffff;
  --searchix-fg: #111827;
  --searchix-radius: 12px;
  --searchix-width: 640px;
  /* ... 60+ more variables */
}

External Links

Items with href automatically show an external link icon:

{
  id: '1',
  title: 'Documentation',
  href: 'https://example.com', // External link icon appears
  icon: 'book'
}

Recent Items ⭐ NEW

Automatically tracks and displays recently selected items:

// Option 1: Auto localStorage (no setup needed!)
<ngx-searchix [items]="items"></ngx-searchix>

// Option 2: Provide initial recents
<ngx-searchix
  [items]="items"
  [recentItems]="recentItems"
></ngx-searchix>

Features:

  • Shows recent items when search is empty
  • Click × to remove items from recents
  • Auto-saves to localStorage (key: searchix-recents)
  • Maximum 10 recent items
  • No manual management needed!

See full documentation

Browser Support

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)

Technical Notes

  • Uses Angular CDK Overlay for modal rendering
  • Event-driven API - emits itemSelected instead of routing internally
  • Peer dependency: Angular >=12 <19
  • Compatible with Angular 12-18

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.