Form Field

A wrapper component that provides a consistent layout for form controls, including labels, hints, and validation errors.

Default & Hints

Combine hlm-form-field with hlm-hint to provide helpful context for your users.

We'll never share your email with anyone else.

Validation & Errors

Use hlm-error to display validation messages when a form control is invalid and has been interacted with.

Your name is required to continue.

Complex Form Integration

Seamlessly integrate with Angular Reactive Forms and various controls like inputs and selects.

Enter your legal name as it appears on your ID.
We'll use this to customize your experience.

Immediate Validation

Using ShowOnDirtyErrorStateMatcher to show errors as soon as the user starts typing.

Immediate Validation Mode

Errors will appear as soon as you start typing (dirty), rather than waiting for the field to be blurred (touched).

API Reference

Helm API

Styling components following the spartan/ui design system.

ComponentSelectorDescription
HlmFormFieldhlm-form-fieldMain wrapper for labels, controls, hints, and errors.
HlmHinthlm-hintUsed to display helpful hint text below the control.
HlmErrorhlm-errorUsed to display validation error messages.

Installation & Usage

Installation

Imports

Error State Matcher

To show errors on dirty instead of touched, add this to your component providers: