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

@pmeig/ngb-form

v2.0.0

Published

A powerful Angular library that provides Bootstrap-styled form validation with advanced features like hover validation and smart form state management.

Readme

@pmeig/ngb-form

A powerful Angular library that provides Bootstrap-styled form validation with advanced features like hover validation and smart form state management.

Installation

  npm install @pmeig/ngb-form

Features

  • 🎯 Smart Form Validation - Automatic Bootstrap validation styling
  • Hover Validation - Show validation states on submit button hover
  • 🔄 Dynamic State Management - Reactive form validation states
  • 🎨 Bootstrap 5.3.3 compatible styling
  • 🚀 Angular 21.2.0 support with signals
  • ♿ Accessibility friendly
  • 📱 Responsive design

Usage

Import the Module

import { FormMaterial } from '@pmeig/ngb-form';

@NgModule({
  imports: [
    FormMaterial
  ],
  // ...
})
export class AppModule { }

Basic Form Validation

The directive automatically applies to all forms and FormGroup elements:

<!-- Template-driven forms -->
<form>
  <div class="mb-3">
    <label for="email" class="form-label">Email</label>
    <input 
      type="email" 
      class="form-control" 
      id="email" 
      name="email"
      [(ngModel)]="email"
      error="Please provide a valid email."
      valid="Nice you have a valid email!"
      required 
      email>
  </div>
  <button type="submit">Submit</button>
</form>

<!-- Reactive forms -->
<form [formGroup]="myForm" (ngSubmit)="onSubmit()">
  <div class="mb-3">
    <input 
      type="text"
      id="username"
      formControlName="username" error="Username is required." is-valid="false"> <!-- force to print error message -->
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>

Advanced Features

Disable Validation

<form [unvalidated]="true">
  <!-- Form content -->
</form>

Custom Hover Elements

<!-- Specify custom elements for hover validation -->
<form [status-hover]="customElements">
  <!-- Form content -->
  <button type="button" #submitBtn class="btn btn-primary">Custom Submit</button>
</form>
export class MyComponent {
  @ViewChild('submitBtn') submitBtn!: ElementRef;
  
  get customElements() {
    return [this.submitBtn.nativeElement];
  }
}

Disable Hover Validation

<form [status-hover]="false">
  <!-- Form content -->
</form>

Directive Properties

BFormDirective

| Property | Type | Default | Description | | --- | --- | --- | --- | | unvalidated | boolean | false | Disables automatic validation styling | | status-hover | Element[] | boolean | true | Controls hover validation behavior |

How It Works

Automatic Validation States

The directive automatically:

  1. Applies Bootstrap classes: Adds form-validation class on initialization
  2. Manages validation states: Toggles was-validated class based on form submission
  3. Handles hover validation: Shows validation states when hovering over submit buttons
  4. Reactive updates: Uses Angular signals for efficient state management

Validation Flow

  1. Initial State: Form loads without validation classes
  2. Hover State: When hovering over submit buttons, validation classes are applied
  3. Submitted State: After form submission, validation persists
  4. Dynamic Updates: Validation states update reactively based on form changes

Bootstrap Classes Support

This library enhances standard Bootstrap 5 form validation classes:

  • was-validated - Applied automatically on form submission or hover
  • form-validation - Added to all forms for enhanced styling
  • is-valid / is-invalid - Works with existing Bootstrap validation
  • valid-feedback / invalid-feedback - Display validation messages

Dependencies

  • Angular: >=21.2
  • @angular/common: >=21.2
  • @pmeig/ngb-core: ^0.0.1
  • tslib: ^2.3.0

Compatibility

  • Angular: 21.2+
  • Bootstrap: 5.3.3+
  • TypeScript: 5.8.3+
  • Modern browsers (Chrome, Firefox, Safari, Edge)

Documentation

License

This project is licensed under the MIT License.

Support

For issues and questions, please open an issue on the GitHub repository.