Utilities
Detect autofill events on input elements. This can be useful for styling or behavior changes when the browser autofills an input. Floating labels are a common use case for this directive.
Import the Autofill primitives from ng-primitives/autofill.
import { NgpAutofill } from 'ng-primitives/autofill';
Assemble the autofill directives in your template.
<input ngpAutofill />
The following directives are available to import from the ng-primitives/autofill package:
The following data attributes are applied to the ngpAutofill directive:
| Attribute | Description |
|---|---|
data-autofill |
Applied when the element is autofilled. |
Copyright © 2026 Angular Primitives
This site is powered by Netlify