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

ngx-numeric-counter

v0.0.4

Published

Angular component for numeric input with increment and decrement buttons.

Readme

ngx-numeric-counter

Angular component for numeric input with increment and decrement buttons.

npm version Downloads


✨ Major Features

✅ Increment and decrement buttons
✅ Works with [(ngModel)] and Reactive Forms
✅ Configurable min, max, and step
✅ Works in standalone components and NgModules
✅ Lightweight and no dependencies


🚀 Installation

Install the package via npm:

npm install --save ngx-numeric-counter

or with yarn:

yarn add ngx-numeric-counter

⚙️ Basic Usage

Import the Component

If you’re using Angular standalone components:

import { Component } from '@angular/core';
import { NgxNumericCounterComponent } from 'ngx-numeric-counter';

@Component({
  standalone: true,
  imports: [NgxNumericCounterComponent],
  template: `
    <ngx-numeric-counter
      [(ngModel)]="quantity"
      [min]="1"
      [max]="10"
      [step]="1"
    ></ngx-numeric-counter>

    <p>Quantity: {{ quantity }}</p>
  `
})
export class DemoComponent {
  quantity = 3;
}

Or import the module in your NgModule:

import { NgxNumericCounterModule } from 'ngx-numeric-counter';

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

✅ Example with Reactive Forms

import { Component } from '@angular/core';
import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { NumericCounterComponent } from 'ngx-numeric-counter';

@Component({
  standalone: true,
  imports: [ReactiveFormsModule, NumericCounterComponent],
  template: `
    <form [formGroup]="form">
      <ngx-numeric-counter
        formControlName="quantity"
        [min]="1"
        [max]="10"
      ></ngx-numeric-counter>
    </form>

    <p>Value: {{ form.value | json }}</p>
  `
})
export class DemoReactiveComponent {
  form: FormGroup;

  constructor(private fb: FormBuilder) {
    this.form = this.fb.group({
      quantity: [5]
    });
  }
}

🔧 Configuration Options

You can pass individual inputs to customize the behavior:

| Property | Type | Default | Description |
|------------------|-----------|----------------------------|-------------------------------------------------|
| min | number | Number.NEGATIVE_INFINITY | Minimum value allowed. |
| max | number | Number.POSITIVE_INFINITY | Maximum value allowed. |
| step | number | 1 | Increment/decrement step value. |
| disabled | boolean | false | Disables the input and the buttons. |
| buttonClass | string | '' | Additional CSS classes for the increment/decrement buttons. |
| inputClass | string | '' | Additional CSS classes for the input field. |
| containerClass | string | '' | Additional CSS classes for the entire component wrapper. |

✅ Example: Tailwind CSS

Here’s how to style the counter with Tailwind:

<ngx-numeric-counter
  [(ngModel)]="qty"
  [buttonClass]="'bg-blue-500 text-white px-3 py-1 rounded hover:bg-blue-600'"
  [inputClass]="'border border-gray-300 w-16 text-center text-lg rounded'"
  [containerClass]="'flex gap-2 items-center'"
></ngx-numeric-counter>

🎯 Compatibility

Angular 17+

Modern browsers

📦 License

MIT © 2025


☕ Buy Me a Coffee

If you find this library helpful, you can support my work:

Buy Me A Coffee

👉 Buy Me a Coffee

🔎 Keywords

angular, ngx, numeric counter, number input, counter input, stepper, angular standalone, angular forms, ngmodule, reactive forms