Socket
Book a DemoInstallSign in
Socket

ngx-horizontal-scroll-menu

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-horizontal-scroll-menu

A lightweight, customizable Angular library for creating beautiful horizontal scrolling menus with smooth navigation controls. Compatible with Angular 19+ and includes 100% test coverage.

2.2.0
latest
Source
npmnpm
Version published
Weekly downloads
46
-45.88%
Maintainers
1
Weekly downloads
Β 
Created
Source

NGX Horizontal Scroll Menu

Known Vulnerabilities npm version HitCount Build Status Coverage Status codebeat badge

πŸš€ Now compatible with Angular 19! Fully updated with 100% test coverage and modern Angular features.

Description

A lightweight, customizable Angular library for creating beautiful horizontal scrolling menus with smooth navigation controls. Perfect for navigation bars, category filters, or any horizontal list that needs elegant scrolling functionality.

✨ Key Benefits:

  • 🎯 Zero Configuration - Works out of the box with sensible defaults
  • 🎨 Fully Customizable - Style with your own CSS classes
  • πŸ“± Responsive - Adapts to different screen sizes
  • ⚑ Lightweight - Minimal bundle size impact
  • πŸ”§ TypeScript Support - Full type safety included
  • πŸ§ͺ 100% Test Coverage - Production-ready reliability

🎯 Live Demo

Try it on StackBlitz β†’

✨ Features

  • πŸ“‹ Dynamic Menu Items - Pass any array of objects as menu items
  • πŸ”— Smart Link Handling - Automatic link detection or custom click events
  • 🎨 Custom Styling - Apply your own CSS classes for background and text
  • πŸƒβ€β™‚οΈ Smooth Scrolling - Configurable scroll speed and distance
  • πŸŽ›οΈ Navigation Controls - Optional left/right arrow navigation
  • πŸ–ΌοΈ Custom Icons - Use your own navigation arrow icons
  • πŸ“± Touch Friendly - Works great on mobile devices
  • β™Ώ Accessible - Keyboard navigation support

πŸ“¦ Installation

npm install ngx-horizontal-scroll-menu --save

πŸš€ Quick Start

1. Import the Module

For Angular 19+ (Standalone Components - Recommended):

import { HorizontalScrollMenuComponent } from 'ngx-horizontal-scroll-menu';

@Component({
  standalone: true,
  imports: [HorizontalScrollMenuComponent],
  // ... your component
})
export class MyComponent { }

Alternative - Using the Module:

import { HorizontalScrollMenuModule } from 'ngx-horizontal-scroll-menu';

@Component({
  standalone: true,
  imports: [HorizontalScrollMenuModule],
  // ... your component
})
export class MyComponent { }

For NgModule-based Apps:

import { NgModule } from '@angular/core';
import { HorizontalScrollMenuModule } from 'ngx-horizontal-scroll-menu';

@NgModule({
  imports: [
    HorizontalScrollMenuModule
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule { }

2. Use in Your Template

Basic Usage:

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
    <ngx-horizontal-scroll-menu
      [items]="menuItems"
      [linkLabel]="'url'"
      [background]="'bg-primary'"
      [text]="'text-white'">
    </ngx-horizontal-scroll-menu>
  `
})
export class AppComponent {
  menuItems = [
    { title: 'Home', url: '/home' },
    { title: 'Products', url: '/products' },
    { title: 'Services', url: '/services' },
    { title: 'About', url: '/about' },
    { title: 'Contact', url: '/contact' }
  ];
}

With Click Events (No Links):

@Component({
  template: `
    <ngx-horizontal-scroll-menu
      [items]="categories"
      (clickedEventEmiiter)="onCategoryClick($event)">
    </ngx-horizontal-scroll-menu>
  `
})
export class AppComponent {
  categories = [
    { title: 'Electronics', id: 1 },
    { title: 'Clothing', id: 2 },
    { title: 'Books', id: 3 },
    { title: 'Sports', id: 4 }
  ];

  onCategoryClick(category: any) {
    console.log('Selected category:', category);
    // Handle navigation programmatically
    this.router.navigate(['/category', category.id]);
  }
}

βš™οΈ API Reference

Input Properties

PropertyTypeDefaultDescription
itemsany[][]Array of menu items to display. Each item should have a title property
linkLabelstring'link'Property name in items that contains the URL. Omit for click events only
backgroundstringundefinedCSS class name for styling the menu background
textstringundefinedCSS class name for styling the menu item text
distancenumber50Scroll distance in pixels when using navigation arrows
scrollSpeednumber100Scroll animation speed in milliseconds (for mousedown events)
hideNavbooleanfalseHide the left/right navigation arrows
leftIconstringBase64 arrowCustom icon for navigation arrows (24px recommended)
navIconImageModelundefinedCustom navigation icon configuration

Output Events

EventTypeDescription
clickedEventEmiiterEventEmitter<any>Emitted when a menu item is clicked. Returns the clicked item object

ImageModel Interface

interface ImageModel {
  type: string;    // Image type (e.g., 'png', 'svg')
  image: string;   // Image URL or base64 data
}

🎨 Styling Examples

Bootstrap Classes:

<ngx-horizontal-scroll-menu
  [items]="items"
  [background]="'bg-dark'"
  [text]="'text-light fw-bold'">
</ngx-horizontal-scroll-menu>

Custom CSS Classes:

.custom-menu-bg {
  background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  padding: 10px;
}

.custom-menu-text {
  color: white;
  font-weight: 600;
  text-transform: uppercase;
}

πŸ”§ Advanced Configuration

Custom Scroll Behavior:

<ngx-horizontal-scroll-menu
  [items]="items"
  [distance]="100"
  [scrollSpeed]="50"
  [hideNav]="false">
</ngx-horizontal-scroll-menu>

πŸ—ΊοΈ Roadmap

  • Virtual Scrolling - Handle thousands of items efficiently
  • Keyboard Navigation - Arrow key support
  • RTL Support - Right-to-left language support
  • Accessibility Improvements - Enhanced ARIA support
  • Animation Presets - Pre-built scroll animations
  • Icon Customization - More flexible icon system

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  • Fork the repository
  • Create your feature branch (git checkout -b feature/AmazingFeature)
  • Commit your changes (git commit -m 'Add some AmazingFeature')
  • Push to the branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Isah Ohieku

⭐ If this library helped you, please give it a star! ⭐

Keywords

angular

FAQs

Package last updated on 20 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.