Function: replace()
replace(
fromElement:ReactiveElementBase|DOMElement,toElement:ReactiveElementBase|DOMElement,options?:object):ReplaceTransition
Creates an in-place element replacement transition swapping two elements smoothly without ghosting.
Parameters
| Parameter | Type | Description |
|---|---|---|
fromElement | ReactiveElementBase | DOMElement | - |
toElement | ReactiveElementBase | DOMElement | - |
options? | { duration?: number; ease?: BuiltinEase | EaseCurve; matchPosition?: boolean; overlap?: number; scale?: number | boolean; } | - |
options.duration? | number | Total choreography duration in seconds (default: 0.5s). |
options.ease? | BuiltinEase | EaseCurve | Easing curve for the incoming element (default: "quartOut"). |
options.matchPosition? | boolean | Automatically match incoming element's (x, y) coordinates to outgoing element (default: true). |
options.overlap? | number | Overlap hand-off point as a fraction of exit progress (default: 0.55). |
options.scale? | number | boolean | Subtle depth scaling factor during swap (default: 0.96, or false to disable). |