This page covers the public APIs that most users do not need on day one.
Provide global defaults through Angular DI.
Good uses:
- default transition duration
- reduced motion policy
Unwrap either a plain value or an Angular Signal<T>.
Use this in library-facing TypeScript code when you want to accept both forms explicitly. Normal application code usually does not need it, because template bindings already make signal-driven inputs reactive.
ng-motion initializes its standard features automatically for normal directive usage. The APIs below are for advanced control:
provideMotionFeatures(bundle)ngmAnimationFeaturesngmAllFeaturesloadNgmFeatures(features)initNgmFeatures()
Use them when you want explicit feature registration or lazy feature bundles. This is the closest equivalent to Framer Motion's LazyMotion story.
import { type ApplicationConfig } from '@angular/core';
import { provideMotionFeatures, ngmAnimationFeatures } from '@scripttype/ng-motion';
export const appConfig: ApplicationConfig = {
providers: [provideMotionFeatures(ngmAnimationFeatures)],
};These are available for advanced composition:
motionValueanimateValueanimateSingleValueframecancelFrame
If you use them directly, you are operating closer to motion-dom than to the high-level Angular API. That is sometimes correct, but it also means Angular-specific ergonomics and cleanup are more your responsibility.
Public advanced exports include:
createVisualElementmountVisualElementupdateVisualElementunmountVisualElementcreateHtmlVisualStatecreateHtmlRenderState- SVG equivalents such as
createSvgVisualElement
These exist for contributors, experiments, and edge-case integrations. They are not the recommended entry point for application code.
The following are public and useful, but easier to misuse:
useAnimationFrame()useMotionValueEvent()framescheduling helpers- reorder primitives
- drag control primitives
The common failure mode is routing high-frequency motion updates back through Angular state too aggressively. Keep hot paths in motion values or direct DOM updates.