Skip to content

API Reference / @gtkx/animated / animated

Variable: animated

const animated: Animated

Defined in: packages/animated/dist/animated.d.ts:18

Wraps a component so that its props accept springs and interpolations: animated(GtkLabel) is GtkLabel with every prop also taking a SpringValue or an Interpolation. Animated values are written to the widget on each frame without a React render. The wrapper of a given component is created once and reused, so repeated lookups render the same component.

Every widget component of the generated @gtkx/jsx store is also available as a property: animated.GtkLabel is animated(GtkLabel) without the import. Elements whose ref does not expose a Gtk.Widget subclass, such as GtkAdjustment, are wrapped through the call form.

Released under the MPL-2.0 License.