Skip to content

ngx-signal-schema

Composable schema validation operators for Angular Signal Forms.

Angular Signal Forms provide a powerful schema system, but complex forms quickly become difficult to structure.

As forms grow, validation logic often spreads across large schema functions, repeated conditions, duplicated validators and dynamic form sections.

ngx-signal-schema adds composable building blocks for structuring form logic in a reusable and maintainable way.

const ContactSchema = append(
BaseSchema,
(path) => {
disabledHidden(
path.companyName,
valueEquals(path.personType, 'private')
);
}
);

The library does not replace Angular Signal Forms. It builds on top of them and focuses on the parts that become repetitive in larger forms.

Compose schemas instead of nesting logic

Build final schemas from small focused fragments instead of putting every rule into one large schema function.

Make branching explicit

Angular Signal Forms provide applyWhen. ngx-signal-schema adds applyIf for cases where both the true and false branch matter.

Keep UI state and validation aligned

Utilities like disabledHidden help ensure irrelevant fields are hidden, disabled and excluded from validation.

Keep the form tree stable

Structure wrappers help represent optional nested objects and collections without constantly removing and recreating form subtrees.

ngx-signal-schema is built around a few simple principles:

  • Prefer composition over large monolithic schemas.
  • Keep conditional logic explicit and reusable.
  • Treat UI state and validation state as one coherent system.
  • Keep form trees stable, even for optional or dynamic structures.
  • Stay aligned with Angular Signal Forms instead of replacing them.

ngx-signal-schema is developed and maintained by the devZWO GmbH.

See the Maintainers page for project background and contribution information.