aholachek / react-flip-toolkit

A lightweight magic-move library for configurable layout transitions
MIT License
4.1k stars 139 forks source link

Add the ability to override the operating system's reduced motion settings #228

Open singintime opened 4 months ago

singintime commented 4 months ago

Motivation

This PR provides a setting to override the reduced motion preference of the operating system. This can be useful in case react-flip-toolkit is used for animations that convey semantic information (e.g. loading spinners), and therefore shouldn't be disabled.

Proposed changes

Instead of a boolean flag, the activation toggle now accepts three possible string values: "on", "off", and "system". "On" and "off" enable and disable FLIP animations under any circumstance, respectively. "System" is the default value, and respects the reduced motion preferences set in the operating system.