usePreferences
Respond to changes in the user’s preferred color scheme and accessibility settings.
Adapt the UI of the application to the user’s OS theme and accessibility settings.
import { usePreferences } from 'react-gui/use-preferences';
const { colorScheme, reducedMotion } = usePreferences();
API #
Return value #
usePreferences
returns an object of property-value pairs for each user preference.
colorScheme string
A string representing the color scheme, either “light” or “dark”.
reducedMotion boolean
A boolean representing preferences for enabling animations and other motion design.