Specialized controls for numeric ranges and date selection.

slider

Numeric range selection.

{
  key: 'volume',
  type: 'slider',
  label: 'Volume',
  value: 50,
  minValue: 0,    // optional
  maxValue: 100,  // optional
  step: 5,        // optional
}

Core Properties (all optional):

  • minValue: Minimum slider value
  • maxValue: Maximum slider value
  • step: Step increment value

The value is a number. Two kits have a range mode that changes it: PrimeNG props.range: true gives number[], and Ionic props.dualKnobs: true gives { lower, upper }. The inferred form value type follows these props.

Adapter Props

Compose NgForgeField via hostDirectives and register the field type with valueFieldMapper. See Building an Adapter for the full guide.

// my-slider.component.ts
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import {
  injectNgForgeField,
  NgForgeControl,
  NgForgeFieldHost,
  type SliderField,
} from '@ng-forge/dynamic-forms/integration';

@Component({
  selector: 'my-slider',
  imports: [NgForgeControl],
  hostDirectives: [NgForgeFieldHost],
  template: `<!-- mark the control element with ngForgeControl so meta + aria land there -->`,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export default class MySliderComponent {
  protected readonly ngf = injectNgForgeField<number>();
  readonly props = input<SliderField['props']>();
}

// my-slider.type.ts
import type { FieldTypeDefinition } from '@ng-forge/dynamic-forms/integration';
import { valueFieldMapper } from '@ng-forge/dynamic-forms/integration';

export const MySliderType: FieldTypeDefinition = {
  name: 'slider',
  loadComponent: () => import('./my-slider.component'),
  mapper: valueFieldMapper,
};

datepicker

Date selection control.

{
  key: 'birthDate',
  type: 'datepicker',
  label: 'Birth Date',
  value: null,
  required: true,
  minDate: new Date(1900, 0, 1),  // optional
  maxDate: new Date(),            // optional
  placeholder: 'Select your birth date',
}

Core Properties (all optional):

  • minDate: Minimum selectable date (Date | string | null)
  • maxDate: Maximum selectable date (Date | string | null)
  • startAt: Initial calendar view date (Date | null)
  • placeholder: Placeholder text (at field level, not in props)

Adapter Props

Compose NgForgeField via hostDirectives and register the field type with datepickerFieldMapper. See Building an Adapter for the full guide.

// my-datepicker.component.ts
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import {
  injectNgForgeField,
  NgForgeControl,
  NgForgeFieldHost,
  type DatepickerField,
} from '@ng-forge/dynamic-forms/integration';

@Component({
  selector: 'my-datepicker',
  imports: [NgForgeControl],
  hostDirectives: [NgForgeFieldHost],
  template: `<!-- mark the control element with ngForgeControl so meta + aria land there -->`,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export default class MyDatepickerComponent {
  protected readonly ngf = injectNgForgeField<string>();
  readonly props = input<DatepickerField['props']>();
}

// my-datepicker.type.ts
import type { FieldTypeDefinition } from '@ng-forge/dynamic-forms/integration';
import { datepickerFieldMapper } from '@ng-forge/dynamic-forms/integration';

export const MyDatepickerType: FieldTypeDefinition = {
  name: 'datepicker',
  loadComponent: () => import('./my-datepicker.component'),
  mapper: datepickerFieldMapper,
};

Selecting several dates

PrimeNG props.selectionMode: 'multiple' | 'range' stores an array of ISO strings, and Ionic props.multiple: true stores an array of Dates. While a range is being picked, the value holds just its start. The inferred form value type follows these props.

Date formats and locale

Each adapter follows its UI library's locale setup:

  • Material uses the app's DateAdapter, MAT_DATE_FORMATS and MAT_DATE_LOCALE when provided, and falls back to the native adapter otherwise. The native adapter only parses typed dates in US order or ISO format, so apps that expect input like 15.12.2026 should provide a parsing adapter such as provideDateFnsAdapter(). With the date-fns adapter, MAT_DATE_LOCALE takes a date-fns Locale object (for example de from date-fns/locale), not a string.
  • Bootstrap renders a native , which uses the browser's locale.
  • PrimeNG parses and displays dates with the dateFormat prop, for example 'dd.mm.yy'. Month and day names come from PrimeNG's translation config.
  • Ionic passes the locale prop to ion-datetime and uses it for the displayed value. It defaults to the browser locale.