Skip to main content

Build Dynamic Forms with JSON Configuration

Mat Dynamic Form is an Angular library that transforms JSON objects into fully functional, beautiful forms using Angular Material components. No more repetitive form code.

Quick Start

Get your first dynamic form running in three simple steps

1

Install the package

Install Mat Dynamic Form and its peer dependency Angular Material:
npm install mat-dynamic-form @angular/material @angular/cdk
2

Import the module

Add MatDynamicFormModule to your Angular module:
app.module.ts
import { NgModule } from '@angular/core';
import { MatDynamicFormModule } from 'mat-dynamic-form';

@NgModule({
  imports: [
    MatDynamicFormModule
  ]
})
export class AppModule { }
3

Create your first form

Define your form structure and add the component to your template:
component.ts
import { Component } from '@angular/core';
import { FormStructure, Input, Button } from 'mat-dynamic-form';

@Component({
  selector: 'app-demo',
  template: '<mat-dynamic-form [structure]="formStructure"></mat-dynamic-form>'
})
export class DemoComponent {
  formStructure = new FormStructure();

  constructor() {
    this.formStructure.title = 'Contact Form';
    this.formStructure.nodes = [
      new Input('name', 'Name'),
      new Input('email', 'Email')
    ];
    this.formStructure.validateActions = [
      new Button('submit', 'Submit', {
        onEvent: (e) => console.log(e.structure.getValue())
      })
    ];
  }
}
Your form is now ready! The library handles all form validation, state management, and Angular Material styling automatically.

Explore Components

Discover the full range of form components available

Input Fields

Text, password, number, and textarea inputs with validation

Dropdowns & Selects

Single and multi-select dropdowns with autocomplete support

Date & Time

Date pickers, time pickers, and date range selectors

File Upload

Drag-and-drop file uploads with validation

Checkboxes & Radios

Checkbox and radio button groups

Custom Components

Integrate your own Angular components

Key Features

Everything you need to build powerful forms

JSON-Driven Configuration

Define complex forms with simple JSON objects. No repetitive template code.

Built-in Validation

Leverage Angular’s reactive forms validators with global and field-level rules.

Material Design

Beautiful, accessible forms using Angular Material components out of the box.

Dynamic Node Management

Add, remove, or modify form fields at runtime based on user interactions.

Learn More

Dive deeper into Mat Dynamic Form

Core Concepts

Understand FormStructure, Nodes, Actions, and Validators

Advanced Features

Explore dynamic forms, custom validators, and event handling

Real-World Examples

See complete examples like sign-up forms and conditional fields

API Reference

Complete API documentation for all classes and methods

Ready to build your first dynamic form?

Follow our quickstart guide and create a fully functional form in minutes.

Get Started Now

Build docs developers (and LLMs) love