effect()
Applies a render effect to this element.
effect(name: RenderEffect.EffectName | undefined, optional?: boolean): this;
Notes
- Render effects handle lifecycle events including entry and exit, for animation or other purposes. Effects must be registered by the platform handler (using e.g. useAnimationEffects()), or by the application on startup.
- Effects do not handle showing and hiding elements using the UIElement.hidden property, only creation and removal by adding or removing elements from containers or UIShowView.
- Multiple effects can be chained (e.g.,
.effect("fadeIn").effect("scaleOut")).
Parameters
- name — The name of the effect to apply.
- optional — True if the effect is optional, and missing effects should not be logged.
Return value
The builder instance for chaining.
Examples
UI.Column(content).effect("fade") // Fades in on render, fades out on removal
UI.Column(content).effect("fadeIn").effect("scaleOut") // Different enter/exit effects
Related
class ElementBuilder abstractstatic
An abstract base class for UI element builders.
