Skip to content

Core Concepts

ngx-signal-schema is built around four complementary concepts.

Each concept solves a different problem. Together, they provide a toolkit for building maintainable Angular Signal Form schemas.

A useful way to think about the library is that form architecture starts with a stable structure and grows into composed schemas.

How the concepts build on each other
Stable Form Structures
Reusable Validators
Conditional Schemas
Schema Composition

The concepts are not isolated features. They describe different layers of the same form architecture.

I have large schemas

Large schema functions become difficult to maintain when validation, UI state and business rules live in the same place.

Start with Schema Composition

I need dynamic forms

Some form sections only apply when another field has a certain value or when a workflow state changes.

Start with Conditional Schemas

I repeat validation logic

Validation logic should not be copied across schemas when it represents a reusable rule or domain concept.

Start with Reusable Validators

Stable form structures define the shape of the form tree.

They help Angular Signal Forms work with data that does not naturally map to predictable form nodes, such as optional nested objects or collections with metadata.

Typical building blocks:

  • OptionalBlock<T>
  • ArrayBlock<T>
From domain model to stable form tree
Domain Model
Structure Wrapper
Stable Form Tree

Use this concept when your form contains optional object trees, dynamic sections or collections that need their own state.

Read more: Stable Form Structures

Reusable validators define what is considered valid.

Instead of repeating validation logic throughout your application, validators encapsulate common rules into reusable functions.

Typical building blocks:

  • requiredTrimmed
  • requiredDefined
  • decimal
  • integer
  • mimeType
Validation as a reusable building block
Field
Validator
Validation Result

Use this concept when the same validation rule appears in multiple places or when a rule represents a domain-specific concept.

Read more: Reusable Validators

Conditional schemas define when something should apply.

Angular Signal Forms already provide applyWhen(). ngx-signal-schema builds on that idea with reusable conditions and explicit branching through applyIf().

Typical building blocks:

  • valueEquals
  • valueIn
  • not
  • applyIf
Explicit conditional branching
Condition
true → Schema A
false → Schema B

Use this concept when a field or section has different active and inactive states.

Read more: Conditional Schemas

Schema composition combines smaller building blocks into larger schemas.

A composed schema can reuse validators, apply conditional branches and work with stable form structures while staying modular.

Typical building blocks:

  • append
  • compose
Composing a final schema
Base Schema +
Validators +
Conditions +
Structure Wrappers
Final Schema

Use this concept when a schema becomes too large or when multiple features need to contribute their own rules.

Read more: Schema Composition

The concepts are designed to be used together. Each concept focuses on a single concern.

A real-world form often combines:

  • Stable Form Structures for optional sections
  • Reusable Validators for field validation
  • Conditional Schemas for dynamic behavior
  • Schema Composition for assembling the final schema

See the complete example:

👉 Company vs Private Person Contact Form

Together they make complex form schemas easier to understand, reuse and evolve.