Learn how to configure Angular Signal Forms to bring back the classic CSS state classes (like ng-valid, ng-invalid, and ng-touched)—either for backward compatibility with existing styles or to unlock new customization, like emitting your own tailored state classes for advanced styling.

emoji_objects emoji_objects emoji_objects
Kevin Kreuzer

Kevin Kreuzer

@nivekcode

Jan 24, 2026

4 min read

Angular Signal Forms Config
share

Angular 21 finally ships Signal Forms, marked as an experimental API — a feature the community has been asking for over a long period.

The direction is unambiguous by now: Signals sit at the foundation of modern Angular. Adoption has spread across Signal Inputs, Queries (viewChild, viewChildren, contentChild & contentChildren), inputs, and the list continues. Even third-party ecosystems such as NgRx are embracing the model accordingly. So the enthusiasm around extending this reactive approach to forms is easy to understand.

This post does not walk through creating Signal Forms, though. What we will cover is configuration, and we'll call out one specific behavioral shift around state classes that deserves your attention.

Prefer watching over reading? A full walkthrough of these concepts is available in the recording from our brand new Angular Signal Forms Workshop.

Where Did the CSS Classes Go?

With template-driven or reactive forms, Angular has always attached state classes directly onto form controls automatically.

These state classes — ng-valid, ng-invalid, and ng-touched among others — mirror the live state of each input. They are convenient because they let you style the interface according to user interaction without putting any extra logic in the template code. You may be using them, for instance, to display a red border whenever a field is invalid or a green checkmark once the field is valid.

Spin up a Signal Form and inspect the resulting HTML, though, and the classes are nowhere to be found. No ng-valid, no ng-dirty — nothing.

Signal Form without CSS state classes

Signal Forms, unless told otherwise, skip attaching any such classes. For a legacy application this can become a real problem. If your global styles target .ng-invalid, your UI will not render as intended.

The Signal Forms Config exists precisely to address this situation.

Preserving Old Behavior with SignalFormsConfig

A new utility function, provideSignalFormsConfig, is provided by Angular for this purpose. If you want the familiar behavior back because of your current CSS dependencies, no manual class binding in the template is required.

Simply configure the global provider with the constant NG_STATUS_CLASSES:

import { provideSignalFormsConfig, NG_STATUS_CLASSES } from '@angular/forms';

export const appConfig: ApplicationConfig = {
  providers: [
    provideSignalFormsConfig({
      classes: NG_STATUS_CLASSES
    })
  ]
};

Once this is in place, your Signal Forms will attach the standard Angular state classes again, which makes migrating a notably smoother experience.

Signal Form with CSS state classes enabled

Custom Class Definitions

But the configuration object covers more than just the default constants. Dynamic definitions are possible as well — useful for instances where you need specialized CSS class names.

Within the configuration, you can map signal state properties directly to the class names you want:

provideSignalFormsConfig({
  classes: {
    'my-company-input-error': ({state}) => state().invalid(),
    'my-company-input-touched': ({state}) => state().touched(),
    'my-company-input-dirty': ({state}) => state().dirty(),
  }
}),

After applying this, every form control updates itself reactively with your custom classes:

Signal Form with custom CSS classes

Why the Config Uses an Object

It is worth noting: provideSignalFormsConfig accepts a configuration object, not a set of individual function arguments.

That is an intentional decision so the API can grow smoothly. Right now our focus is on CSS classes, but supplying a configuration object means future configuration options can be added by the Angular team without breaking the function signature.

Signal Forms may be experimental, but approaches like this make it evident that both a polished developer experience — e.g., a minimal, clean DOM — and workable migration strategies are high on the priority list.

TL;DR

  • Signal Forms in Angular 21 no longer attach CSS state classes by default — no ng-valid, ng-invalid, ng-touched, or the like.
  • Combine provideSignalFormsConfig with NG_STATUS_CLASSES for backward compatibility with pre-existing styles.
  • To roll your own custom class names, add dynamic mappings that depend on signal state functions.
  • Choosing a configuration object vs. multiple parameters makes the API possible to extend later without breaking changes.

Ready to take a deeper dive into Angular Signal Forms? Our full Angular Signal Forms Workshop is loaded with practical, hands-on labs to guide you further!

Do you enjoy the theme of the code preview? Explore our brand new theme plugin

Skol - the ultimate IDE theme

Skol - the ultimate IDE theme

Northern lights feeling straight to your IDE. A simple but powerful dark theme that looks great and relaxes your eyes.

Build smarter UIs with Angular + AI

Angular + AI Video Course

Angular + AI Video Course

A hands-on course showing how to integrate AI into Angular apps using Hash Brown to build intelligent, reactive UIs.

Learn streaming chat, tool calling, generative UI, structured outputs, and more — step by step.

Want a practical guide to Angular Signal Forms architecture, validation, and migration?

Angular Signal Forms eBook

Angular Signal Forms eBook

Build typed, validated, production-ready Angular forms with signals using a model-first approach.

Learn schema-driven validation, form-state signals, custom controls, Reactive Forms migration, and clean API mapping patterns.

Do you enjoy the content and want to master Angular's brand new Signal Forms?

Angular Signal Forms: Hands-On Masterclass

Angular Signal Forms: Hands-On Masterclass

Master Angular's brand new Signal-Forms through 12 progressive chapters with theory and hands-on labs.

Learn form basics, validators, custom controls, subforms, migration strategies, and more!

Win win deal illustration

Get notified
about new blog posts

Sign up for Angular Experts Content Updates & News and you'll get notified whenever we release a new blog posts about Angular, Ngrx, RxJs or other interesting Frontend topics!

We will never share your email with anyone else and you can unsubscribe at any time!

Emails may include additional promotional content, for more details see our Privacy policy.

Responses & comments

Do not hesitate to ask questions and share your own experience and perspective with the topic

Further Reading

Explore these related posts from the Angular Experts team to deepen your understanding of modern Angular signal-based forms and patterns.

Angular Signal Forms: Custom Controls Without ControlValueAccessor

Reusable Custom Controls Without ControlValueAccessor

Discover how to build reusable Angular custom controls using FormValueControl, model(), touch events, and schema-driven validation—without needing a ControlValueAccessor.

Intermediate · Kevin Kreuzer · Aug 12, 2026 · 7 min read

Kevin Kreuzer Angular Signal Forms: The Missing Create/Edit Pattern

The Missing Create/Edit Pattern

Learn a practical approach for handling create and edit flows with Angular Signal Forms, covering route-based modes, loading edit data, linkedSignal prefill, submit branching, and validation context.

Intermediate · Kevin Kreuzer · Aug 1, 2026 · 6 min read

Kevin Kreuzer Angular Signal Forms Essentials

Signal Forms Essentials

Grasp the core ideas behind modern Angular Forms. This guide walks you through creating Signal Forms, binding them in templates, using built-in and custom validators, solving cross-field validation, submitting forms, and more.

Beginner · Kevin Kreuzer · Feb 14, 2026 · 12 min read

Kevin Kreuzer

Empower your team with our extensive experience. Angular Experts have spent years consulting with enterprises and startups alike, leading workshops and tutorials, and maintaining rich open source resources. We take great pride in our experience in modern front-end and would be thrilled to help your business boom.