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

@nysds/angular

v1.22.0

Published

Angular components for the New York State Design System, generated from the NYSDS web components.

Readme

@nysds/angular

Angular components for the New York State Design System (NYSDS). Generated from the NYSDS web components library, with full support for template-driven forms, Reactive Forms, and Signal Forms.

Install

Setup a new Angular project

npm install -g @angular/cli
ng new my-angular-app

Install NYS Design System

npm install @nysds/angular @nysds/styles

Peer dependencies: Angular >=20.0.0 (core, common, forms).

Load styles

Add NYSDS styles to your angular.json:

{
  "projects": {
    "your-app": {
      "architect": {
        "build": {
          "options": {
            "styles": [
              "node_modules/@nysds/styles/nysds-full.min.css"
            ]
          }
        }
      }
    }
  }
}

First component

Import standalone components directly into your component:

import { Component, signal } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { NysButtonComponent } from '@nysds/angular';
@Component({
  imports: [RouterOutlet, NysButtonComponent],
  selector: 'app-root',
  styleUrl: './app.css',
  templateUrl: './app.html',
})
export class App {
  protected readonly title = signal('my-angular-app');
  handleSubmit() {
    console.log('Button clicked!');
  }
}

NgModule support has been deprecated

Use "Standalone Components" instead.

Inputs, outputs, and two-way binding

All properties are typed inputs; events are typed outputs. No CUSTOM_ELEMENTS_SCHEMA needed:

<nys-textinput
  [label]="'Email'"
  [required]="true"
  (nysChange)="onEmailChange($event)"
></nys-textinput>

Event detail is typed:

onEmailChange(event: NysTextinputChangeEvent) {
  console.log(event.detail.value); // autocompletes
}

Signal Forms Known Limitations

When using Angular's Signal Forms with [formField], be aware of these constraints:

  • name property overwrite: The [formField] binding overwrites the name attribute. This is an Angular Signal Forms limitation; there is no workaround on the component side. Use a different approach for form arrays that require distinct names.
  • pattern validation on empty array: Angular's Signal Forms passes an empty array for unset pattern metadata. The component defensively ignores these writes; no action needed on your side.

Forms

Template-driven forms

Use [(ngModel)] with form components:

<form>
  <nys-textinput [(ngModel)]="email" name="email"></nys-textinput>
  <nys-checkbox [(ngModel)]="agreed" name="agreed"></nys-checkbox>
</form>

Reactive Forms

Use formControl or formControlName:

form = this.fb.group({
  email: ["", [Validators.required, Validators.email]],
  agreed: [false, Validators.required],
});
<form [formGroup]="form">
  <nys-textinput formControlName="email"></nys-textinput>
  <nys-checkbox formControlName="agreed"></nys-checkbox>
</form>

Signal Forms (Angular 21+)

Use [formField] with a form field definition:

email = signal<string>("");
emailControl = new FormControl<string>("", Validators.required);
<nys-textinput [formField]="emailControl"></nys-textinput>

Group controls

nys-checkboxgroup and nys-radiogroup bind at group level:

form = this.fb.group({
  languages: [["en"], Validators.required],
});
<nys-checkboxgroup formControlName="languages">
  <nys-checkbox value="en">English</nys-checkbox>
  <nys-checkbox value="es">Spanish</nys-checkbox>
</nys-checkboxgroup>

Validation

By default, the component owns validation. Its required and pattern attributes drive ElementInternals validation, shown on blur.

To let Angular own validation instead, add the nysControlErrors directive:

<nys-textinput
  formControlName="email"
  nysControlErrors
></nys-textinput>

The directive subscribes to control.errors and sets the component's showError and errorMessage. Override the default messages:

providers: [
  {
    provide: NYS_ERROR_MESSAGES,
    useValue: {
      required: () => "Please fill in this field",
      email: () => "Enter a valid email",
    },
  },
]

Disabled state

FormControl({ disabled: true }) disables the component:

control = new FormControl({ value: "", disabled: true });
<nys-textinput [formControl]="control"></nys-textinput>

Server-side rendering

The components render client-side. For SSR, wrap containers in ngSkipHydration:

<div ngSkipHydration>
  <nys-textinput></nys-textinput>
</div>

Or use provideClientHydration if registering components client-only.

Zoneless

The component outputs use Angular's output() function, which integrates with zoneless change detection. Zoneless apps work without extra configuration.

Subpath imports

Import individual components:

import { NysTextinputComponent } from "@nysds/angular/textinput";
import { NysCheckboxComponent } from "@nysds/angular/checkbox";

License

MIT