# ngx-form-lib

> Dynamic form library for Angular 18 with Material 3 support. Create complex reactive forms easily using JSON configuration with modern Angular 18 control flow syntax.

Latest version **0.3.0** (published 2025-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-form-lib
pnpm add ngx-form-lib
yarn add ngx-form-lib
bun add ngx-form-lib
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2025-07-20 |
| First published | 2022-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 382.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Navdeep Singh |
| Maintainers | nav2510 |
| Keywords | angular, angular-18, angular forms, reactive-forms, angular-material, material-3, dynamic forms, form-library, json-forms, type-forms, control-flow, typescript |

## Links

- npm: https://www.npmjs.com/package/ngx-form-lib
- Repository: https://github.com/Nav2510/ngx-form-lib
- Homepage: https://ngx-form-lib.web.app
- Issues: https://github.com/Nav2510/ngx-form-lib/issues
- npm.io page: https://npm.io/package/ngx-form-lib

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.0 (latest) — 2025-07-20
- 0.2.0 — 2023-09-04
- 0.1.6 — 2022-05-14
- 0.1.4 — 2022-05-09
- 0.1.3 — 2022-05-09
- 0.0.1 — 2022-04-21

## README

![alt text](https://github.com/Nav2510/form-lib-workspace/blob/develop/src/assets/icons/logo-lg.svg?raw=true)


## Create dynamic forms in Angular quickly and effortlessly

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Nav2510_ngx-form-lib&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Nav2510_ngx-form-lib)

This package simplifies Angular form creation with full Angular reactive capabilities by offering a straightforward class configuration. It leverages Angular Material, utilizing material themes for enhanced functionality.

## Homepage

Configure your form directly on [NgxFormLib](https://ngx-form-lib.web.app/) or play with forms on [Stackblitz](https://stackblitz.com/edit/angular-ivy-5hodcd)


## Installation

1. In your angular project run command `npm install --save ngx-form-lib` and install the package.
2. This library use [Angular material](https://material.angular.io/) for themes. So, if you have already setup `Angular material` skip step 4.
3. You also need to install `peer dependencies`. [Installing npm peer dependencies](https://www.npmjs.com/package/npm-install-peers).
4. Setup angular material in your project. [Getting started guide](https://material.angular.io/guide/getting-started).
5. Import `BrowserAnimationModule` in `app.module.ts`.
```javascript
// ... Other imports
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

@NgModule({
  imports: [
    ...,
    BrowserAnimationsModule
  ],
  ...,
})
export class AppModule { }
```
6. Import `FormLibModule` from `ngx-form-lib` and add it into the imports array of your module.
```javascript
import { NgModule } from '@angular/core';
import { FormLibModule } from 'ngx-form-lib';

import { CommonModule } from '@angular/common';

@NgModule({
  declarations: [HomeComponent],
  imports: [
    CommonModule,
    FormLibModule,
  ],
})
export class HomeModule {}
```

7. Create a constant file with form configuration. You can directly create form configuration on [NgxFormLib webpage](https://ngx-form-lib.web.app/) and use it in your projects. IDE support will provide with autofill for various properties.
```javascript
import { ParentConfig, Input, Field, Config } from "ngx-form-lib";

export const CONFIG: Config = {
    header: 'Form Header',
    parentConfig: new ParentConfig({
      appearance: 'fill',
      color: 'primary',
    }),
    sections: [
      {
        sectionHeader: 'Section Header',
        fields: [
          new Input({
            subType: 'text',
            field: new Field({
              type: 'input',
              name: 'money',
              label: 'Enter your name',
              order: 1,
              classes: ['ngf-col-12'],
            }),
          }),
        ],
      },
    ],
  };
  ```


8. Bind the configuration with `config` property of `ngx-for-lib` component.
```html
<ngx-form-lib [config]="CONFIG"></ngx-form-lib>
```

### Style error fix

If you find breaking style with material form just install `peer dependencies` manually and rerun the project.

### List of supported component

1. Input
2. Textarea
3. Checkbox
4. Radio
5. Button
6. Dropdown


# Features and releases
### Current features

1. Dynamic components
2. Field Dependencies
3. Facets implementations (hidden, disable, set value)

### Next release version features

1. Form dependencies

# Further help

To get more help, issues or any suggestions for the `ngx-form-lib` mail to  `navdeep.dev2510@gmail.com` with subject `ngx-form-lib`.

---
_Source: https://npm.io/package/ngx-form-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
