# NG Dynamic Forms
[](https://badge.fury.io/js/%40ng-dynamic-forms%2Fcore)
[](https://travis-ci.org/udos86/ng-dynamic-forms)
[](https://codecov.io/gh/udos86/ng-dynamic-forms)
[](https://deepscan.io/dashboard/#view=project&pid=562&bid=912)
[](https://npmjs.org/package/@ng-dynamic-forms/core)
***
NG Dynamic Forms is a **rapid form development library** based on the official Angular
[**dynamic forms guide**](https://angular.io/docs/ts/latest/cookbook/dynamic-form.html).
It **fully automates form UI creation** by introducing a set of maintainable **form control models** and **dynamic form control components**
**Out of the box support** is provided for all popular UI libraries including **[Material](https://material.angular.io/)**, **[ngx-bootstrap](https://valor-software.com/ngx-bootstrap/#/)**, **[NG Bootstrap](https://ng-bootstrap.github.io/#/home)**, **[Foundation](http://foundation.zurb.com/)**, **[Ionic](http://ionicframework.com/)**, **[Kendo](http://www.telerik.com/kendo-angular-ui)** and **[PrimeNG](http://www.primefaces.org/primeng/#/)**.
Explore the [**live sample**](http://ng2-dynamic-forms.udos86.de/sample/index.html) and the [**API documentation**](http://ng2-dynamic-forms.udos86.de/docs/index.html)!
## Table of Contents
- [Getting Started](#getting-started)
- [Running the Sample](#running-the-sample)
- [Basic Usage](#basic-usage)
- [UI Modules](#ui-modules)
- [Form Groups](#form-groups)
- [Form Arrays](#form-arrays)
- [Form Layouts](#form-layouts)
- [Form Control Configuration](#form-control-configuration)
- [Form Control Events](#form-control-events)
- [Updating Form Controls](#updating-form-controls)
- [Custom Templates](#custom-templates)
- [Custom Validators](#custom-validators)
- [Custom Form Controls](#custom-form-controls)
- [Validation Messaging](#validation-messaging)
- [Related Form Controls](#related-form-controls)
- [JSON Export & Import](#json-export--import)
- [JSON Form Models](#json-form-models)
- [Text Masks](#text-masks)
- [Autocompletion](#autocompletion)
- [FAQ](#faq)
- [Appendix](#appendix)
## Getting Started
**1. Install the core package**:
```
npm i @ng-dynamic-forms/core -S
```
**2. Install a [UI package](#ui-modules) and its peer dependencies**:
```
npm i @ng-dynamic-forms/ui-material -S
```
## Running the Sample
**1. Clone the Git repository**:
```
git clone https://github.com/udos86/ng-dynamic-forms.git
cd ng-dynamic-forms
```
**2. Install the dependencies**:
```
npm i
```
**3. Build the library**:
```
npm run build:lib
```
**4. Run the application**:
```
ng serve
```
## Basic Usage
**1. Import the UI module**:
```typescript
import { DynamicFormsMaterialUIModule } from "@ng-dynamic-forms/ui-material";
@NgModule({
imports: [
ReactiveFormsModule,
DynamicFormsMaterialUIModule
]
})
export class AppModule {}
```
**2. Define your form model**:
```typescript
import {
DynamicFormModel,
DynamicCheckboxModel,
DynamicInputModel,
DynamicRadioGroupModel
} from "@ng-dynamic-forms/core";
export const MY_FORM_MODEL: DynamicFormModel = [
new DynamicInputModel({
id: "sampleInput",
label: "Sample Input",
maxLength: 42,
placeholder: "Sample input"
}),
new DynamicRadioGroupModel