Skip to content

API Reference / @gtkx/animated / useReducedMotion

Variable: useReducedMotion

const useReducedMotion: () => boolean | null

Defined in: packages/animated/dist/reduced-motion.d.ts:11

Reports whether the desktop asks for less motion: true while GTK's gtk-enable-animations setting is off, which is when every spring already jumps straight to its target, and also while the gtk-interface-reduced-motion setting of GTK 4.22 asks to reduce motion, the preference behind the prefers-reduced-motion media query, which leaves springs running so that components can trade a slide for a fade themselves. Returns null until a display is open.

Returns

boolean | null

true when motion should be reduced, false when it should not, null when unknown.

Released under the MPL-2.0 License.